function matrixinfo(m) % matrix_info(m) % Tell the user whether mtx is a square matrix. If it is a square matrix, % display the matrix's transpose and inverse. msize = size(m); if ndims(m) == 2 && msize(1) == msize(2), disp('It''s a square matrix.'); disp('The transpose is:'); disp(m'); disp('The inverse is:'); disp(inv(m)); else disp('The matrix isn''t square.'); end % if end % function