When I export results to a text file or csv etc, it is written in only one line, how do I make that it appear in columns?

2 ビュー (過去 30 日間)
Hello!
sigma, x, res... are all 10 dimensional vectors that I want them to appear in different columns. When I run the code everything in the txt file is in one line, separated with comas.
T=table(sigma,x,res,dist,k,p);
csvFile = 'table_data.csv';
writetable(T, csvFile);
  6 件のコメント
Samuel Tárraga Habas
Samuel Tárraga Habas 2023 年 12 月 7 日
The first one! Thank you for the clarification.
Stephen23
Stephen23 2023 年 12 月 8 日
編集済み: Stephen23 2023 年 12 月 8 日
"sigma, x, res... are all 10 dimensional vectors..."
Note for the future: they have only two dimensions. And ten elements each.
ndims(0:9)
ans = 2
numel(0:9)
ans = 10

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

採用された回答

Voss
Voss 2023 年 12 月 7 日
T=table(sigma(:),x(:),res(:),dist(:),k(:),p(:), ...
'VariableNames',{'sigma','x','res','dist','k','p'});
csvFile = 'table_data.csv';
writetable(T, csvFile);
  4 件のコメント
Samuel Tárraga Habas
Samuel Tárraga Habas 2023 年 12 月 7 日
Yessss!!! It worked, I thought I had to remove the 3 dots. Thank you very much.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by