[英]export matlab output to an excel file with location specified for a range of data
我想將matlab輸出導出到從G2列開始的excel文件中,為此,我編寫的代碼正確地導出了數據,但沒有導出到所需位置。它以21行而不是2行打印。 該代碼是
ResultFile = xlsread('filename');
sz= size(ResultFile,1);
b= num2str(sz+1);
location = strcat('G2',b);
fprintf('value in location is %g\n',location);
xlswrite('filename',fnlarray,'Sheet1',location);
在命令中
xlswrite(filename,A,sheet,xlRange)
您可以將xlRange
指定為定義所需輸出區域的角的字符串,或者(假設已指定工作表)僅給出左上單元格的坐標。 如果要在“ G2的下方和右側”區域中寫入數組,這應該足夠了:
location = 'G2';
現在,對我來說,將“ G2”與excel文件的行數+ 1連接起來似乎並不是很有意義。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.