insertin string variables to headers

3 ビュー (過去 30 日間)
antonet
antonet 2012 年 5 月 23 日
Hi all,
I have the matrix A which is A=
Columns 1 through 7
'l12' 'l13' 'l14' 'l15' 'l23'
and i want to apply something like
header={ 'time' A }; xlswrite('filename.xlsx', header) but it does not work as when i open the excel file i see as header only 'time' and not the elements of A.

採用された回答

Jessica Lam
Jessica Lam 2012 年 5 月 23 日
hope it helps .....
output=cell(1,length(A));
output(1,1)=cellstr('time' );
output(1,2:length(A)+1)=num2cell(A);
xlswrite('filename.xlsx', output);
  1 件のコメント
antonet
antonet 2012 年 5 月 23 日
Hi jessica
Just a small correction and it seems that it works!
Instead of output(1,2:length(A)+1)=num2cell(A);
replace with output(1,2:length(A)+1)=A;
thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by