img = imread("C:\Users\C010\Documents\zaamin\1.jpg");
if size(img, "c") == 3 then
 img_gray = rgb2gray(img);
end
[rows, cols] = size(img);
Sx = 1.5;
Sy = 1.5;
new_rows = round(rows * Sy);
new_cols = round(cols * Sx);
scaled_img = uint8(zeros(new_rows, new_cols));
for i = 1:new_rows
 for j = 1:new_cols
 orig_i = round(i / Sy);
 orig_j = round(j / Sx);
 if orig_i < 1 then orig_i = 1; end
 if orig_i > rows then orig_i = rows; end
 if orig_j < 1 then orig_j = 1; end
 if orig_j > cols then orig_j = cols; end
 scaled_img(i, j) = img(orig_i, orig_j);
 end
end
subplot(1,2,1);
imshow(img);
title("original image")
subplot(1,2,2);
imshow(scaled_img);
title("scaled image")
