clear format compact %% A = [ 2 0; 1 -1 ] %% % The default norm returned by the |norm| command is the 2-norm. twonorm = norm(A) %% % You can get the 1-norm as well. onenorm = norm(A, 1) %% % The 1-norm is equivalent to max( sum(abs(A), 1) ) % sum along rows (1st matrix dimension) %% % Similarly, we can get the infinity-norm and check our formula for it. infnorm = norm(A, inf) max( sum(abs(A), 2) ) % sum along columns (2nd matrix dimension)