how to get a polynomial eqn in variable i want ?

1 vue (au cours des 30 derniers jours)
aditya om
aditya om le 30 Août 2014
>>poly2sym([1 2 -1 1], s)
while using the poly2sym function as " >>poly2sym(c,y), " where c is the coeff. vector array ,i'm getting the error "undefined variable or func. y" , how do i get a pol. eqn . in variable i desire ?

Réponses (1)

Star Strider
Star Strider le 30 Août 2014
Declare y as a symbolic variable first:
c = [1 2 -1 1]; % Polynomila Coefficients
syms y
poly2sym(c,y)
produces:
ans =
y^3 + 2*y^2 - y + 1

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by