Error When Using Writetable

6 ビュー (過去 30 日間)
NA
NA 2021 年 1 月 16 日
コメント済み: NA 2021 年 1 月 16 日
I have this cell
Using the below code to make a table:
Table_1 = cell2table(g_final,'VariableNames',{'test1' 'test2' 'test3' ...
'test4' 'test5' 'test6'});
By using 'writetable'
filename = 'final_test.xlsx';
writetable(Table_WLS,filename,'Sheet',m,'Range','D1')
But I got this error:
Error using writetable
Dimensions of arrays being concatenated are not consistent.
I do not know, why I get this error and how to make it works.

採用された回答

Ive J
Ive J 2021 年 1 月 16 日
test2 variable is the one causing this error. If you want that empty column in your output XLSX file:
Table_WLS.test2 = repmat({''}, size(Table_WLS, 1), 1); % or any alternatives converting 1X0 -> 0X0
But since it's empty, why not just remove it?
Table_WLS.test2 = [];
  1 件のコメント
NA
NA 2021 年 1 月 16 日
Thank you so much.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResults, Reporting, and Test File Management についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by