フィルターのクリア

How to save subplots into an image?

8 ビュー (過去 30 日間)
Kash Costello
Kash Costello 2018 年 3 月 23 日
コメント済み: Rik 2018 年 3 月 23 日
So, I have this code here for my subplots.
n=64
figure(n);
Imin=1;
for I=Imin:31
im1=rot90(reshape(f_1(:,I,:),NX,NZ),1); % (I-1)*2+2
subplot(4,8,[I]); imshow(im1,[]); % [I-Imin+1]
end
and I want to save all 64 subplots as 64 images. I found this code below and they say it's going to save the subplots as images but i'm not successful in doing so.
folder = 'E:\Mae\Matlab_images';
baseFileName = sprintf('Image #%d.png', n);
fullFileName = fullfile(folder, baseFileName);
imwrite(im1, fullFileName);
can anyone help me? It's really tedious to manually save each one of them so i need a code that will automatically save them. Thanks a lot!
  1 件のコメント
Rik
Rik 2018 年 3 月 23 日
The only difference between imshow and imwrite is how you scale the image data. imshow is rescaling the color limits, but imwrite is not. What is the data type of im1 and what are the min and max values?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by