Download this file

23 lines (17 with data), 324 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
% display gray images
function disImgs(I,num)
% I : input images as a 2D/3D matrix
% number of images to displayed
if nargin==1
num=1;
end
[x y z]=size(I);
npx=ceil(num/5);
npy=max([ceil(num/5),5]);
figure
for k=1:num
subplot(npx,npy,k);
imagesc(I(:,:,k));
colormap(gray);
end
end