36 DEFUN (eig, args, nargout,
38 @deftypefn {Built-in Function} {@var{lambda} =} eig (@var{A})\n\
39 @deftypefnx {Built-in Function} {@var{lambda} =} eig (@var{A}, @var{B})\n\
40 @deftypefnx {Built-in Function} {[@var{V}, @var{lambda}] =} eig (@var{A})\n\
41 @deftypefnx {Built-in Function} {[@var{V}, @var{lambda}] =} eig (@var{A}, @var{B})\n\
42 Compute the eigenvalues (and optionally the eigenvectors) of a matrix\n\
43 or a pair of matrices\n\
45 The algorithm used depends on whether there are one or two input\n\
46 matrices, if they are real or complex and if they are symmetric\n\
47 (Hermitian if complex) or non-symmetric.\n\
49 The eigenvalues returned by @code{eig} are not ordered.\n\
50 @seealso{eigs, svd}\n\
55 int nargin = args.
length ();
57 if (nargin > 2 || nargin == 0 || nargout > 2)
72 int arg_is_empty =
empty_arg (
"eig", nr_a, nc_a);
75 else if (arg_is_empty > 0)
90 arg_is_empty =
empty_arg (
"eig", nr_b, nc_b);
93 else if (arg_is_empty > 0)
109 if (nargin == 2 && nr_b != nc_b)
133 result =
FloatEIG (ftmp_a, nargout > 1);
142 result =
FloatEIG (fctmp_a, nargout > 1);
145 else if (nargin == 2)
155 result =
FloatEIG (ftmp_a, ftmp_b, nargout > 1);
165 result =
FloatEIG (fctmp_a, fctmp_b, nargout > 1);
171 if (nargout == 0 || nargout == 1)
199 result =
EIG (tmp_a, nargout > 1);
208 result =
EIG (ctmp_a, nargout > 1);
211 else if (nargin == 2)
221 result =
EIG (tmp_a, tmp_b, nargout > 1);
231 result =
EIG (ctmp_a, ctmp_b, nargout > 1);
237 if (nargout == 0 || nargout == 1)