Saving matlab results many times using loop
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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!
1 comentario
Respuestas (1)
Kevin Phung
el 5 de Feb. de 2019
Editada: Kevin Phung
el 5 de Feb. de 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 comentarios
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!