How to extract coefficients from given symbolic polynomial in MatLab? sym2poly -- MatLab

How to extract coefficients from given symbolic polynomial in MatLab? sym2poly -- MatLab


How to extract coefficients from given symbolic polynomial in MatLab? 
[Ans]
sym2poly 

[description]
extract coefficients from given polynomial.

more details on:

code:
clear
clc
syms x
c = sym2poly(x^3 - 2*x - 5)
fprintf("1\n");
c = sym2poly(1/2*x^3 - 2/3*x - 5)
fprintf("2\n");
result:

c =

1 0 -2 -5

1

c =

0.5000 0 -0.6667 -5.0000

Comments

Popular posts from this blog

How to get an approximately value with number data with specified polynomial in MatLab? - polyfit -- MatLab

How to find coefficient of a polynomial in MatLab? - coeffs -- MatLab

How to get interploated values corresponding to the query point in MatLab? - spline -- MatLab