Write plot data in loop to file
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Low-Level File I/O에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!