populating the cells of a 10*1 column vector cell array
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I wish to populate the above cell array where each cell is a 50*1 double
At the moment I hold the values of the ten 50*1 doubles in an excel spreadsheet
It has 10 rows and 50 columns
How do I populate the cells of my cell array ?
Bob M
0 comentarios
Respuestas (1)
Voss
el 14 de Dic. de 2023
You can try this, where filename is the (absolute or relative) path to your spreadsheet file:
M = readmatrix(filename); % M: 10x50 double (expected)
C = num2cell(M.',1).'; % C: 10x1 cell array; each cell contains a 50x1 double
Example:
M = reshape(1:500,10,[])
C = num2cell(M.',1).'
C{1}
C{2}
0 comentarios
Ver también
Categorías
Más información sobre Spreadsheets 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!