این هم مثال:
clc;clear;
a = randi(9,4);
b = randi(9,4);
c = randi(9,4);
d = randi(9,4);
% --------------------------------------------------------
minz1 = zeros(4);
for i = 1 : 4
for j = 1 : 4
minz1(i,j) = (c(i,j) * a(i,j)) + (b(i,j) * d(i,j));
end
end
disp('minz1');
disp(minz1);
% --------------------------------------------------------
minz2 = c.*a + b.*d;
disp('minz2');
disp(minz2);