how save plot in specific folder ?

108 Ansichten (letzte 30 Tage)
Muhannad Saleh
Muhannad Saleh am 10 Mär. 2021
Kommentiert: Jan am 11 Mär. 2021
i uesd ( spectrogram ) to plot pic i need save this pic in specific folder i created i use ( exportgraphics ) but is save in current folder how can save with any folder whant

Akzeptierte Antwort

Jan
Jan am 10 Mär. 2021
Add the wanted path to the file name:
filename = fullfile('D:\Your\Folder', 'File.jpg')
exportgraphics(obj, filename)
  3 Kommentare
Muhannad Saleh
Muhannad Saleh am 11 Mär. 2021
how can save more pic in loop with difrient name ?
Jan
Jan am 11 Mär. 2021
Folder = 'D:\Your\Folder';
for k = 1:100
filename = sprintf('File%03d.jpg', k);
file = fullfile(Folder, filename);
exportgraphics(obj, file);
end

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Ruger28
Ruger28 am 10 Mär. 2021
In older versions of MATLAB:
filename = fullfile('D:\Your\Folder', 'File.jpg');
saveas(MyFigure,filename);
  1 Kommentar
Muhannad Saleh
Muhannad Saleh am 11 Mär. 2021
how can save more pic in loop with difrient name ?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Printing and Saving 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