필터 지우기
필터 지우기

Saving matlab file with identifier

조회 수: 1 (최근 30일)
Ulrik Nash
Ulrik Nash 2011년 6월 29일
Hi Everyone,
Suppose I have a simulation, that I run for different parameter settings. After each run, I wish to save my Matlab data. I obviously do not wish the new file to replace the old. Instead I wish my file to be identified with the setting I am running. So for example, suppose I have a parameter called number_of_agents, which is different for each simulation run, how do I save a file, that incorporates the value from number_of_agents as part of the filename?
Regards,
Ulrik.

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 6월 29일
I don't see a straightforward method, but you can still do it with some manipulation. For example:
FileName='MyData#Agents';
save([FileName,num2str(number_of_agents,4)]);
The idea is to append 4 digits of the value of number_of_agents to your data file name.
  댓글 수: 1
Ulrik Nash
Ulrik Nash 2011년 6월 29일
Thank you Fangjun Jiang, that is what I was looking for.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by