MATLAB: How to display all selected region in the one figure

ellipseimage processingImage Processing Toolboxmask

N = 5 ;
I = imread('13170.jpg');
iwant = cell(N,1) ;
for i = 1:N
im = imshow(I);
e = imellipse(gca);% now pick ROI
setColor(e, 'red');
position = wait(e);
BW = createMask(e,im);% get BW mask for that ROI
BW(:,:,2) = BW;
BW(:,:,3) = BW(:,:,1);
ROI = I;
ROI(BW == 0) = 255;
iwant{i} = ROI ;
end
for i = 1:N
figure
imshow(iwant{i},'Border','tight');
end

Best Answer

Here is a sample using subplot.
figure,
for i = 1:N
subplot(2,3,i),imshow(iwant{i});
end