Write plot data in loop to file

1 回表示 (過去 30 日間)
kayak
kayak 2013 年 10 月 18 日
回答済み: Simon 2013 年 10 月 18 日
How do I output the data of each plot in this loop to file? The x variables are the same for all plots while the Y variable changes.
{
for i=1:2:length(data)
plot(data{i}.z,data{i}.mass);
hold all
}
At the end, I would like to have a datafile with several columns like
{
data{i}.z data{1}.mass data{2}.mass data{3}.mass ...and so on}
Thanks for your help.

回答 (1 件)

Simon
Simon 2013 年 10 月 18 日
Hi!
Look at the commands
fopen
fprintf
fclose
to write to a file. You may use the open/close commands before/after the loop and the fprintf command inside the loop.

カテゴリ

Help Center および File ExchangeLow-Level File I/O についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by