How to write data to an excel file?
Show older comments
In the process of learning how to write data to an excel file, I learnt that I should first write it as a table. So I gave it a try but what my code does is write two row vectors as one long row vector. I wanted to write two variables as two separate rows. Here is my attempt:
(My final goal is to save my workspace data to an excel file.)
data1 = 1:1:10;
data2 = 10:10:100;
data =[data1; data2];
T1 = table(data);
writetable(T1)
1 Comment
Walter Roberson
on 1 May 2019
In the majority of cases you should create the variables as with tables columns not rows
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!