how to convert a matrix to a cell array
Mostrar comentarios más antiguos
Hi there,
I have a 2x10 matrix. Would anybody know how I could convert it into a 1x10 cell array - so that each cell contains a 2x1 matrix?
I'm new to matlab and would appreciate any help.
Kind Regards
John
Respuesta aceptada
Más respuestas (1)
venkat vasu
el 30 de Jul. de 2012
Editada: Walter Roberson
el 30 de Jul. de 2012
X= reshape(1:20,2,10)'
C = mat2cell(X, [1,10],[2,1]);
celldisp(C);
1 comentario
william katzianer
el 21 de Jul. de 2020
This does not work
Categorías
Más información sobre Resizing and Reshaping Matrices 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!