how to display using subplot one by one.

3 ビュー (過去 30 日間)
preeti
preeti 2014 年 12 月 24 日
編集済み: Image Analyst 2014 年 12 月 24 日
clc
clear all
c=cell(1,4);
for i=1:4
c{i}=imread(sprintf('%d.jpg',i));
imshow(c{i});
imshow(sprintf('%d.jpg',i));
end

回答 (1 件)

Sean de Wolski
Sean de Wolski 2014 年 12 月 24 日
Add this line to the first part of your for-loop
subplot(2,2,i)
  1 件のコメント
Image Analyst
Image Analyst 2014 年 12 月 24 日
編集済み: Image Analyst 2014 年 12 月 24 日
And add this too
baseFileName = sprintf('%d.jpg',i);
fullFileName = fullfile(pwd, baseFileName);
if exist(fullFileName, 'file')
c{i}=imread(fullFileName);
else
c{i} = [];
message = sprintf('Warning: %s does not exist', fullFileName);
uiwait(warndlg(message));
end

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

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by