How to write cell array to excel file
Show older comments
I have a cell array whose elements have different sizes. How can I write it to an excel file?
For example:
a = rand(10,1);
b = rand(5,1);
c = rand(4,8);
X = {a, b, c};
How can I export X to an excel file?
Accepted Answer
More Answers (2)
Try this:
writecell(X, 'X.xlsx')
2 Comments
Walter Roberson
on 9 Apr 2020
The result of that would be a single row with numel(a)+numel(b)+numel(c ) columns.
parham kianian
on 10 Apr 2020
Qiang Lei
on 20 May 2022
0 votes
writetable(cell2table(X), 'X.xlsx')
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!