Plotting Cells from a Cell array in order to create a raster plot. Please Help
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Geoff Hayes
le 22 Mar 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?
Réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!