How to loop CSVwrite
3 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
Azzi Abdelmalek
2014-5-6
编辑:Azzi Abdelmalek
2014-5-6
for i=1:10
filename = sprintf('Pressure%d.csv',i);
csvwrite(filename,P)
end
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!