Hello Iam new(and dumb) to matlab and I am struggling with export data to Excel. What I need is on the firts picture, that vector is in one cell (example vector [1,0,0,0,0] is in one cell of that table, ) but when I export it to excell what I got is that every number is in its cell separeted(another picture). Can you please help me with that? Thank you.

1 件のコメント

dpb
dpb 2020 年 10 月 31 日
You can only put multiple numeric values into a single Excel cell if they are text. You'll have to convert to a string or cell string to do that.

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

回答 (1 件)

Adam Danz
Adam Danz 2020 年 10 月 31 日
編集済み: Adam Danz 2020 年 11 月 2 日

0 投票

As dpb mentioned, you'll have to convert those vectors to strings.
C = {[0 1 1 0 0 1], [0 1 1 1], [0 0 0 0], [1], [1 1 1 1 ]};
Cstr = cellfun(@num2str,C,'UniformOutput',false)
Cstr = 1x5 cell array
{'0 1 1 0 0 1'} {'0 1 1 1'} {'0 0 0 0'} {'1'} {'1 1 1 1'}
writecell(Cstr', 'zapis.xlsx')

1 件のコメント

Dominik Sustr
Dominik Sustr 2020 年 11 月 2 日
Thank you guys you were right thank you for the help!

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

製品

リリース

R2020b

タグ

質問済み:

2020 年 10 月 31 日

編集済み:

2020 年 11 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by