Plotting Cells from a Cell array in order to create a raster plot. Please Help
Mostrar comentarios más antiguos
I am having trouble with plotting the cells from a cell array. The array has 158 cells of varying sizes and i wish to plot them on a raster plot with 8 different graphs. So far I have :
for i = 1:8
indDir1 = find(direction==1);
indDir2 = find(direction==2);
indDir3 = find(direction==3);
indDir4 = find(direction==4);
indDir5 = find(direction==5);
indDir6 = find(direction==6);
indDir7 = find(direction==7);
indDir8 = find(direction==8);
indDir = [indDir1;indDir2;indDir3;indDir4;indDir5;indDir6;indDir7;indDir8];
numTrials = length(indDir);
subplot(3,3,graph(i));hold on; % this is all for the subplots..here is not the issue
for i = 1: size(instruction)
spiketimes{i} = num2cell(neuron1.times(neuron1.times(:,1) >= instruction1sb(i) &
neuron1.times(:,1) < instruction1sa(i)))
end; % This is how i created the cell array with 158 cells for each trial
for j = [1:numTrials];
n = length(spiketimes);
% Here is where I have no idea how to plot these cells
plot([spiketimes ;spiketimes ], [ones(n,1)*j-1; ones(n,1)*j]);
end;
end;
Please help!!!
3 comentarios
Shane Hagen
el 21 de Mzo. de 2015
Editada: Geoff Hayes
el 22 de Mzo. de 2015
Geoff Hayes
el 22 de Mzo. de 2015
Shane - if you step through the code (using the debugger) what can you tell us about spiketeimes? How many elements are in this array - 158? What are you attempting to do with
plot([spiketimes ;spiketimes ], [ones(n,1)*j-1; ones(n,1)*j]);
I don't understand why you are concatenating spiketimes with itself and then repeating this for each trial. What are you attempting to do with the ones(n,1)*j-1? What does this mean?
Shane Hagen
el 22 de Mzo. de 2015
Editada: Shane Hagen
el 22 de Mzo. de 2015
Respuestas (0)
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!