tomwalters@0: % demonstration file for 'aim-mat' tomwalters@0: % tomwalters@0: % (c) 2006-2008, University of Cambridge, Medical Research Council tomwalters@0: % Written by Tom Walters (tcw24@cam.ac.uk) tomwalters@0: % http://www.pdn.cam.ac.uk/cnbh/aim2006 tomwalters@0: % $Date: 2008-06-10 18:00:16 +0100 (Tue, 10 Jun 2008) $ tomwalters@0: % $Revision: 585 $ tomwalters@0: tomwalters@0: function plot_strobes(input, options, current_scale, titlestr) tomwalters@0: tomwalters@0: start_time=options.minimum_time; tomwalters@0: stop_time=options.maximum_time; tomwalters@0: tomwalters@0: sig=input.data.signal; tomwalters@0: current_frame=input.data.nap; tomwalters@0: strobes=input.data.strobes; tomwalters@0: input.info.current_plot=4; tomwalters@0: str=get_graphics_options(input,input.info.current_strobes_module); tomwalters@0: str.minimum_time_interval=start_time; tomwalters@0: str.maximum_time_interval=stop_time; tomwalters@0: duration=stop_time-start_time; tomwalters@0: sig=getpart(sig,start_time,stop_time); tomwalters@0: nrchan=getnrchannels(current_frame); tomwalters@0: temp_scale=1; % for debugging tomwalters@0: % make the dots of a size of constant ratio to the window size tomwalters@0: axpos=get(gcf,'Position'); tomwalters@0: marker_dot_size=axpos(3)/168; tomwalters@0: tomwalters@0: %several channels tomwalters@0: hand=plot(current_frame/temp_scale,str);hold on tomwalters@0: xlabel('time (ms)');ylabel('Frequency (kHz)');title(titlestr); tomwalters@0: colscale=length(hsv)/nrchan; tomwalters@0: for i=1:nrchan tomwalters@0: if isfield(strobes,'grouped') tomwalters@0: nr_sources=size(strobes.cross_strobes{1}.source_cross_channel_value,2); tomwalters@0: cols=hsv; tomwalters@0: % first plot the originals tomwalters@0: % herestrobes=strobes.original{i}; tomwalters@0: % nr_here=length(herestrobes.strobes); tomwalters@0: % col=cols(round(i*colscale),:); tomwalters@0: % xoffs=-0.001; tomwalters@0: % for j=1:nr_here tomwalters@0: % time=herestrobes.strobes(j); tomwalters@0: % if time>start_time & time1 tomwalters@0: colnr=round(k*length(hsv)/nr_sources); tomwalters@0: colnr=min(colnr,length(hsv)); tomwalters@0: colnr=max(colnr,1); tomwalters@0: col=cols(colnr,:); tomwalters@0: cursize=target_chan_act/100; tomwalters@0: else tomwalters@0: continue tomwalters@0: end tomwalters@0: time=herestrobes(j); tomwalters@0: if time>start_time & timestart_time & time