populating the cells of a 10*1 column vector cell array
1 view (last 30 days)
Show older comments
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 Comments
Answers (1)
Voss
on 14 Dec 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 Comments
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!