Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Writing a matrix to Excel

1 回表示 (過去 30 日間)
Lennard Pol
Lennard Pol 2020 年 11 月 26 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi all,
I am writing certain data to an Excel file, which is partly depicted below. First, I did this via xlswrite and now via writematrix, see below too. Both give the same unsatisfying output in Excel.
writematrix(data_matrix,iccp_file,'Sheet',sheet,'Range','A2')
The problem is that numbers of which the third digit after the comma is a zero, are written in General number format (e.g. cell B8 and B9) and other numbers are written in Excel as Number number format. The numbers in B8, B9 and comparable cells are actually the right values. The biggest problem is that the number format differs throughout the Excel file (If all numbers where 'wrong', I could just divide by 1000).
Thanks for helping me out!
Lennard

回答 (1 件)

Pier Giorgio Petrolini
Pier Giorgio Petrolini 2020 年 11 月 26 日
Hello Lennard, have you tried to use "writetable" instead of "writematrix" ? I've never had this problem with the other function.
You can convert your matrix "data_matrix" into a table using the "array2table" function, and than export the dataset to an xlsx file using "writetable".
I hope it helps. Let me know!
Kind regards,
Pier Giorgio
  1 件のコメント
Lennard Pol
Lennard Pol 2020 年 11 月 26 日
Thanks for your help Pier Giorgio. Unfortunately, it didn't change the resulting Excel file..

タグ

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by