Answer:
Check the explanation
Step-by-step explanation:
% iterate through each column (outer loop) , then iterate rows-1 (inner loop)
%take product of adjacent rows
mat = input('enter 5 by 5 matrix : ');
[R,C] = size(mat);
max_prod =0;
for c =[1:C]
for r=[1:(R-1)]
temp = mat(r,c)*mat((r+1),c);
if max_prod<temp
max_prod=temp;
end
end
end
fprintf('Greatest product : %i\\', max_prod)
Kindly check the output in the attached image below.