how can i save the output of the loop

1 Ansicht (letzte 30 Tage)
Ali
Ali am 2 Dez. 2014
Kommentiert: Ali am 2 Dez. 2014
I want to make this loop:
for i=46100:1:46200
shotnumber=i;
function
save ifile
clear
end
each number of 'i' represents a data file and i need to apply a 'function' to these files from 46100 to 46200. I need to save all files under the name "number" which is 'i' attached to the word "file", so that each time the name differs by the increment of i. Is that possible?

Akzeptierte Antwort

Thorsten
Thorsten am 2 Dez. 2014
filename = sprintf('file%d', i);
save(filename)

Weitere Antworten (0)

Kategorien

Mehr zu Communications Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by