Azzera filtri
Azzera filtri

Saving matlab file with identifier

1 visualizzazione (ultimi 30 giorni)
Ulrik Nash
Ulrik Nash il 29 Giu 2011
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.

Risposta accettata

Fangjun Jiang
Fangjun Jiang il 29 Giu 2011
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 Commento
Ulrik Nash
Ulrik Nash il 29 Giu 2011
Thank you Fangjun Jiang, that is what I was looking for.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by