How to save the 60 value in two columns as a csv file?

9 ビュー (過去 30 日間)
Dhiyaa Al-Shammari
Dhiyaa Al-Shammari 2020 年 1 月 27 日
編集済み: Stephan 2020 年 1 月 27 日
for example
Start_point end_point
545 7679
778 566
454 434
untile to 60 rows
saving this table above as a csv file format
  2 件のコメント
dpb
dpb 2020 年 1 月 27 日
See
doc writetable
Dhiyaa Al-Shammari
Dhiyaa Al-Shammari 2020 年 1 月 27 日
I have used it but save the last iteration from the table
like this code
for i=1 to 60
start_index=x(i);
end_index=y(i);
T= table(start_index,end_index);
end
writetable(T,'ndnd.csv');
it just save the last iteration in the file ndnd

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

回答 (1 件)

Stephan
Stephan 2020 年 1 月 27 日
編集済み: Stephan 2020 年 1 月 27 日
Use writematrix for this beginning from R2019a. For earlier releases you can use csvwrite.
If x and y are of size 60x1 why not just use:
writematrix([x, y],'ndnd.csv');
instead of a for loop?

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by