how to display using subplot one by one.
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
Sean de Wolski
2014년 12월 24일
Add this line to the first part of your for-loop
subplot(2,2,i)
댓글 수: 1
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
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!