Put a variable in a file title name
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
yusra Ch
am 18 Okt. 2020
Kommentiert: yusra Ch
am 18 Okt. 2020
Hello,
I want to run a for loop that has an id=1:100 and at the end of each iteration I want matlab to save the results under a file name "Trace_id". So at the end of the programe I will have files called Trace_1 , Trace_2 ,etc...
Thank you
1 Kommentar
Akzeptierte Antwort
Ameer Hamza
am 18 Okt. 2020
Bearbeitet: Ameer Hamza
am 18 Okt. 2020
Something liks this
for id=1:100
% do your processing
M; % matrix to write to file
filename = sprintf('Trace_%d', id);
writematrix(M, filename)
end
3 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Environment and Settings 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!