Home > freetb4matlab > polynomial > roots.m

roots

PURPOSE ^

%

SYNOPSIS ^

function r = roots (v)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {} roots (@var{v})
%
% For a vector @var{v} with @math{N} components, return
% the roots of the polynomial
% @iftex
% @tex
% $$
% v_1 z^{N-1} + \cdots + v_{N-1} z + v_N.
% $$
% @end tex
% @end iftex
% @ifnottex
%
% @example
% v(1) * z^(N-1) + @dots{} + v(N-1) * z + v(N)
% @end example
% @end ifnottex
%
% As an example, the following code finds the roots of the quadratic
% polynomial
% @iftex
% @tex
% $$ p(x) = x^2 - 5. $$
% @end tex
% @end iftex
% @ifnottex
% @example
% p(x) = x^2 - 5.
% @end example
% @end ifnottex
% @example
% @group
% c = [1, 0, -5];
% roots(c)
% @result{}  2.2361
% @result{} -2.2361
% @end group
% @end example
% Note that the true result is
% @iftex
% @tex
% $\pm \sqrt{5}$
% @end tex
% @end iftex
% @ifnottex
% @math{+/- sqrt(5)}
% @end ifnottex
% which is roughly
% @iftex
% @tex
% $\pm 2.2361$.
% @end tex
% @end iftex
% @ifnottex
% @math{+/- 2.2361}.
% @end ifnottex
% @seealso{compan}
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sat 16-May-2009 00:04:49 by m2html © 2003