Plot data from cell array
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Auryn_
el 4 de Ag. de 2017
Respondida: Cong Ba
el 4 de Ag. de 2017
Hi,
I have a cell array of 1x7 cell and each of this is a 1x100 double. I would like to make a surf plot like: surf(100,7,mycell) but I do not know how to convert the data of the cell to plot. If I use cell2mat it results in a 1x707 double array, and that is not what I need. Thanks in advance for your reply.
0 comentarios
Respuesta aceptada
Cong Ba
el 4 de Ag. de 2017
Try if this works for you:
%%a is a cell array of 1x7 cell and each of this is a 1x100 double
a = cell(1,7);
for i = 1:7
a{i} = rand(1,100);
end
%%what you need
b = reshape(cell2mat(a),[100,7]);
surf(b);
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!