Home > freetb4matlab > symbolic > sym2poly.m

sym2poly

PURPOSE ^

% Returns the coefficients of the symbolic polynomial expression @var{p}

SYNOPSIS ^

function c = sym2poly(p,x)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {} @var{c} = sym2poly (@var{p}, @var{x})
% Returns the coefficients of the symbolic polynomial expression @var{p}
% as a vector. If there is only one free variable in @var{p} the
% coefficient vector @var{c} is a plain numeric vector. If there is more
% than one free variable in @var{p}, a second argument @var{x} specifies the
% free variable and the function returns a list of symbolic expressions.
% The coefficients correspond to decreasing exponent of the free variable.
%
% Example:
% @example
% symbols
% x=sym('x'); y=sym('y');
% c = sym2poly (x^2+3*x-4);    % c = [1,3,-4]
% c = sym2poly (x^2+y*x,x);    % c = list(2,y,0)
% @end example
%
% If @var{p} is not a polynomial the result has no warranty.
%
% @end deftypefn
% @seealso{poly2sym,polyval,roots}

CROSS-REFERENCE INFORMATION ^

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