Saving matlab results many times using loop
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hello everyone,
I am having this problem: I need to input different set of data to my code and save results once for a run for 400 times. The problem is I need to save mat file 400 times with 400 different name, anyone here knows how to do it? I am sure it is pretty simple thing, but I have not been able to do so. I would greatly appreciate your response. I want to reiterate again: problem is to save matlab results 400 times with 400 different names (maybe using idices, but I do not know how to do it) using a loop.
Thank you!
Risposte (1)
Kevin Phung
il 5 Feb 2019
Modificato: Kevin Phung
il 5 Feb 2019
just do:
my_filenames = {'file1','file2','file3'}
for i = 1:length(my_filenames)
save(my_filenames{i},'someVariable')
end
edit:
you can programmatically create 400 file names, for example:
my_filenames=cell(1,400)
for i = 1:400
cell{i} = ['file' num2str(i)] %file1, file2, file3, etc
end
0 Commenti
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements 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!