clc;
close all;
imtool close all;
clear;
workspace;
format longg;
format compact;
fontSize = 20;
image1 = imread('moon.tif');
[rows1 columns1 numberOfColorChannels1] = size(image1)
subplot(2, 2, 1);
imshow(image1);
axis on;
title('Large Grayscale Image', 'FontSize', fontSize);
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
image2 = imread('cameraman.tif');
[rows2 columns2 numberOfColorChannels2] = size(image2)
subplot(2, 2, 2);
imshow(image2);
title('Small Grayscale Image', 'FontSize', fontSize);
axis on;
row1 = 30;
col1 = 51;
row2 = row1 + rows2 - 1;
col2 = col1 + columns2 - 1;
image1(row1:row2, col1:col2) = image2;
subplot(2, 2, 3);
imshow(image1);
axis on;
caption = sprintf('Small Image Pasted\ninto Large Image', 'FontSize', fontSize);
title(caption, 'FontSize', fontSize);
Best Answer