How to output specific matrix component to excel?

1 回表示 (過去 30 日間)
Craig
Craig 2013 年 5 月 7 日
I have a 3x3x4000 array, named 'a'
I wish to output the first row, first column term of the first 500 of these into an excel sheet.
n=1:500
xlswrite('MatlabOut.xls', a(1,1,n) )
returns the error message:
"__??? Error using ==> xlswrite at 156 Dimension of input array cannot be higher than two.
Error in ==> Matlab5 at 3517 xlswrite('MatlabOut.xls', a(1,1,n)) "
What would be the best way to do this?
Any help appreciated

回答 (1 件)

Iman Ansari
Iman Ansari 2013 年 5 月 8 日
Hi. Convert it to two dimensional, then use xlswrite:
a=rand(3,3,4000);
a1=a(1,1,1:500);
a2=a1(:);
xlswrite('MatlabOut.xls',a2)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by