function rho = spectral_radius(A) % % Compute the spectral radius of ``A``, which is not necessarily % Hermitian. % % This is slow. Don't use it on big matrices. % % INPUT: % % ``A`` -- The matrix whose spectral radius you want. % % OUTPUT: % % ``rho`` -- The spectral radius of ``A``. % rho = max(abs(eig(A))); end