how save plot in specific folder ?

조회 수: 168 (최근 30일)
Muhannad Saleh
Muhannad Saleh 2021년 3월 10일
댓글: Jan 2021년 3월 11일
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

채택된 답변

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

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Ruger28
Ruger28 2021년 3월 10일
In older versions of MATLAB:
filename = fullfile('D:\Your\Folder', 'File.jpg');
saveas(MyFigure,filename);
  댓글 수: 1
Muhannad Saleh
Muhannad Saleh 2021년 3월 11일
how can save more pic in loop with difrient name ?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by