% Checkcom
% Creates two matrices and checks if they commute.
% Minas Spetsakis, Jan. 2021

S=rand(4)/1000000;
A=S+S';
B=S-S';
norm(A*B-B*A)%/norm(A*B)
% Uncomment /norm(A*B) to see what the effect is

A=eye(4)+S;
B=eye(4)-S;
norm(A*B-B*A)
norm(A*B-B*A)/norm(A*B)

