Saving workspace variables iteratively

조회 수: 2 (최근 30일)
Jeff
Jeff 2017년 12월 9일
답변: Matt J 2017년 12월 9일
I would like to iteratively save my workspace variables to disk upon completion of a FOR loop. For example, for the 1st iteration I would save to output1.mat & the 2nd would be output2.mat. Unfortunately, the HELP for the SAVE command does not provide any option on how to change the filename iteratively as I am proposing.
Does anyone have any suggestions on how to do this? My m-file is attached. Line 63 is where I save the workspace variables.

채택된 답변

Matt J
Matt J 2017년 12월 9일
for i=1:N
save(['output' num2str(i)])
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by