Image file saving location

2 views (last 30 days)
형준 이
형준 이 on 19 May 2022
Commented: 형준 이 on 19 May 2022
my code ↓
for i = 1:5
h = imagesc(X, Y, Z(:,:,i)); xlim([-2 2]); ylim([-1 1]);
fname = ['Image', num2str(i)];
print(fname, '-djpeg');
end
How do I save the image file to folder 'C:\Users\leehj\Desktop\aaa' ?

Accepted Answer

Walter Roberson
Walter Roberson on 19 May 2022
outdir = 'C:\Users\leehj\Desktop\aaa';
for i = 1:5
h = imagesc(X, Y, Z(:,:,i)); xlim([-2 2]); ylim([-1 1]);
fname = fullfile(outdir, ['Image', num2str(i)]);
print(fname, '-djpeg');
end
  2 Comments
형준 이
형준 이 on 19 May 2022
thank you ver much :- )

Sign in to comment.

More Answers (1)

KSSV
KSSV on 19 May 2022
thepath = 'C:\Users\leehj\Desktop\aaa\' ;
for i = 1:5
h = imagesc(X, Y, Z(:,:,i)); xlim([-2 2]); ylim([-1 1]);
fname = [thepath,'Image', num2str(i)];
print(fname, '-djpeg');
end
  1 Comment
형준 이
형준 이 on 19 May 2022
thank you ver much :- )

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!