% precedenceMultiply.m
% Check the precedence of operators: .* & *
clear;
A = rand(2); B = rand(2); C = rand(2);
% case 1:
MTX1 = (A.*B)*C;
MTX2 = A.*B*C;
MTX3 = A.*(B*C);
disp([ MTX1 MTX2 MTX3 ] );

% case 2:
MTX1 = (A*B).*C;
MTX2 = A*B.*C;
MTX3 = A*(B.*C);
disp([ MTX1 MTX2 MTX3 ] );

% RESULT: In either case
% MTX1 == MTX2 != MTX3
% Operations .* and * have the same precedence,
% and are operated from left to right.

