From: Michael Orlitzky Date: Wed, 8 May 2013 06:42:47 +0000 (-0400) Subject: Add the spectral_radius() function. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=2c7ba2642519192bdfb77a4ffa26b16640ab5f77;p=octave.git Add the spectral_radius() function. --- diff --git a/spectral_radius.m b/spectral_radius.m new file mode 100644 index 0000000..47cfd72 --- /dev/null +++ b/spectral_radius.m @@ -0,0 +1,17 @@ +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