%% Customize Number of Images in Tiled Image
% Using a data set containing multiple images, tile the images in a grid.
% Load the MRI data set.

load mri
out = imtile(D, map);
imshow(out);

% Create a tiled image containing only the first eight images in the data set. Use the 'GridSize' parameter to arrange the images in a 2-by-4 grid.

out = imtile(D, map, 'Frames', 1:8, 'GridSize', [2 4]);
figure;
imshow(out);

% Copyright 2018 The MathWorks, Inc.