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
% @tex
% $$
% v_1 z^{N-1} + \cdots + v_{N-1} z + v_N.
% $$
% @end tex
% @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
% @tex
% $$ p(x) = x^2 - 5. $$
% @end tex
% @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
% @tex
% $\pm \sqrt{5}$
% @end tex
% @ifnottex
% @math{+/- sqrt(5)}
% @end ifnottex
% which is roughly
% @tex
% $\pm 2.2361$.
% @end tex
% @ifnottex
% @math{+/- 2.2361}.
% @end ifnottex
% @seealso{compan}
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003