Writing Cell Arrays to Excel

5 ビュー (過去 30 日間)
Neha
Neha 2014 年 2 月 3 日
コメント済み: Neha 2014 年 2 月 3 日
Hello,
I am trying to export a cell array into Excel.
Currently the code looks like this:
CellArray={'Data','# of Pause Points','Start frame','End frame';filename,pausepts,Sframe,Eframe}
Which displays in the command window like this:
'Data' '# of Pause Points' 'Start frame' 'End frame'
[1x37 char] [ 79] [79x1 double] [79x1 double]
When I open the excel file, the 'Data' and '# of Pause Points' information is in the cells, but the [79x1 double] for 'start frame' and 'end frame' are not displayed in the excel file.
I am not sure what I need to do to resolve this, any guidance would be appreciated.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 2 月 3 日
編集済み: Azzi Abdelmalek 2014 年 2 月 3 日
% Look at this example
n=79;
v={'h1' 'h2' 'h3' 'h4';'a' 'b' rand(n,1) rand(n,1)} % Your cell array
h=v(1,:)
a=[v(2,1:2);repmat({[]},n-1,2)]
b=num2cell(cell2mat(v(2,3:4)))
vfinal=[h;[a b]]
% Then use xlswrite with vfinal
  3 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 2 月 3 日
編集済み: Azzi Abdelmalek 2014 年 2 月 3 日
Look at edited answer and don't forget to accept the answer if it helps
Neha
Neha 2014 年 2 月 3 日
n is adjustable, but I know what it would be.

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

その他の回答 (0 件)

カテゴリ

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