I'm trying to create a new data set in CSV format for each loop as I do not want to overwrite the CSV file.
Below is what I have inside the loop but of course it will overwrite through the loop. What I want to output is Pressure1, Pressure2 and so on. My variable is P for pressures in the code.
For i=1:10
filename = 'Pressure.csv';
csvwrite('Pressure',P')
end
I'd appreciate your help.
Thanks in advance.

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 5 月 6 日
編集済み: Azzi Abdelmalek 2014 年 5 月 6 日

3 投票

for i=1:10
filename = sprintf('Pressure%d.csv',i);
csvwrite(filename,P)
end

1 件のコメント

Thamer
Thamer 2014 年 5 月 6 日
Thanks appreciate the help.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

質問済み:

2014 年 5 月 6 日

コメント済み:

2014 年 5 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by