%This function plots raster plots of activity on each cell for multiple %trial datasets function Rasterize_Mult(spks,time_vec,spk_nums,time_win), spks; %Logical matrix of spikes from array time_vec; %Time vector associated with spks spk_nums; %Vector of [First_Cell Last_Cell] to display time_win; %Vector of [Start_Time Stop_Time] to display %Create figure and turn hold on figure(1); hold on; %Find indexes of times to be displayed tmp = find((time_vec >= time_win(1)) & (time_vec <= time_win(2))); start = tmp(1); stop = tmp(length(tmp)); %Plot raster plot for desired cells for j = spk_nums(1):spk_nums(2), %Plot for each of the trials for k = 1:size(spks,1), plot(time_vec(start:stop),(j+(k-1)/size(spks,1)/2)*spks(k,start:stop,j),'b.','Markersize',4); end; end; xlabel('Time (ms)'); ylabel('Pad #'); title('Raster Plot of Responses Over Entire Array vs. Time'); axis([time_vec(start) time_vec(stop) spk_nums(1)-0.5 spk_nums(2)+0.5]);