How to write data from matlab to excel horizontally?

1 次查看(过去 30 天)
Dear all,
Please any advice on this is much appreciated.
If i use this command:
xlswrite('xxxtrice.xlsx', output, 'Sheet1', 'G2');
Then the data in excel will show like this: G2, G3, G4 etc
However I would like the data to appear in excel like this: G2, H2, I2
The size of output changes all the times so I cannot specify the range of G2 easily.
Any help is welcome
Regards
S

采纳的回答

Joseph Cheng
Joseph Cheng 2014-7-28
What you would need to to is make the output a 1x3 array. i'm assuming that the output is a 3 row and 1 column array?
if i did a test like this
x = randi(10,1,10);
xlswrite('book1.xls',x,'sheet1','G10')
i get it across the columns
if i do
x = randi(10,10,1);
xlswrite('book1.xls',x,'sheet1','G10')
i get it just down column G.

更多回答(0 个)

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by