How to store a number of arrays in excel file?
1 次查看(过去 30 天)
显示 更早的评论
Hallo Everyone
I am writing data into an excel file. However, the range of the data to be stored keeps changing and I want to change the range in the xlswrite command accordingly. Any ideas what can be done?
For example:
A=data1; % 1 by 12 matrix(present). However, data1 is a matrix whose rows and column numbers keep on changing
xlswrite(filename,A,'sheet1','A1:A12');
I want to change this range 'A1:A12' as the data1 keeps changing.
Thanks a lot.
0 个评论
采纳的回答
Vishal Rane
2013-7-19
编辑:Vishal Rane
2013-7-19
Dim = size(data1); % output is [ m, n]
Range = ['A1:',strrep([char(64+floor(Dim(2)/26)),char(64+rem(Dim(2),26))],'@',''),num2str(Dim(1))] % Range required for data1
xlswrite( filename, data1, 'sheet1', Range);
You will have to put a check for upper and lower limit since excel 10 supports 256 cols and 65536 rows only.
2 个评论
Vishal Rane
2013-7-19
编辑:Vishal Rane
2013-7-19
oops ! evidently i did'nt think that through !
Answer updated !
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!