]> gitweb.michael.orlitzky.com - octave.git/blob - spectral_radius.m
Add the spectral_radius() function.
[octave.git] / spectral_radius.m
1 function rho = spectral_radius(A)
2 %
3 % Compute the spectral radius of ``A``, which is not necessarily
4 % Hermitian.
5 %
6 % This is slow. Don't use it on big matrices.
7 %
8 % INPUT:
9 %
10 % ``A`` -- The matrix whose spectral radius you want.
11 %
12 % OUTPUT:
13 %
14 % ``rho`` -- The spectral radius of ``A``.
15 %
16 rho = max(abs(eig(A)));
17 end