How can I write the cell array to an excel

Hey everybody,
How can I write my cell array to an excel file?
It is a cell array of the dimension 1*101.
I also attached the code, it is pretty simple. What I am trying to do is write the cell Array P to an excel file.
Thanks a lot in advance,
Johnny

7 件のコメント

Walter Roberson
Walter Roberson 2020 年 7 月 16 日
You are overwriting the same location in the same sheet of the same file each time.
Jonathan Babitsch
Jonathan Babitsch 2020 年 7 月 16 日
Thank you Walter, what can i do instead?
My goal is to write the first Vector in the Array to A1:C1, the second in A2:C2 and so on until A101:C:101...
My idea:
writecell(P,'C.xls','Sheet',1,'Range','A1:C101')
But that doesn`t work, any suggestions whats missing?
Walter Roberson
Walter Roberson 2020 年 7 月 16 日
If they are numeric contents, then cell2mat() the cell to create a numeric array and writematrix() that.
Jonathan Babitsch
Jonathan Babitsch 2020 年 7 月 16 日
Thank you, that worked for me even though I wanted the x-coordinates in the A-column, the y-Coordinates in the B-Column and the z-coordinates in the C-column in excel. Now I have got x in line1, y in line 2 and z in line 3. Is there a quick possibility to change that?
I attached my code if you want to look at it.
Big thank you this far!
Walter Roberson
Walter Roberson 2020 年 7 月 16 日
Transpose the array?
Jonathan Babitsch
Jonathan Babitsch 2020 年 7 月 17 日
Wow that was easy, sorry for annoying you...
Thanks heaps Walter!!
Jonathan Babitsch
Jonathan Babitsch 2020 年 7 月 18 日
Is there a possibility to mark your comment as accepted answer because it was you who led me the right way?

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

 採用された回答

Walter Roberson
Walter Roberson 2020 年 7 月 18 日

0 投票

cell2mat() the cell array, and if necessary, transpose it with .'

その他の回答 (1 件)

KSSV
KSSV 2020 年 7 月 16 日

0 投票

1 件のコメント

Jonathan Babitsch
Jonathan Babitsch 2020 年 7 月 16 日
That doesn't help, whatever I use it doesn't do what I want...
My goal is to write the first Vector in the Array to A1:C1, the second in A2:C2 and so on until A101:C:101...
My idea:
writecell(P,'C.xls','Sheet',1,'Range','A1:C101')
But that doesn`t work, any suggestions whats missing?

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

カテゴリ

ヘルプ センター および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by