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
1 0 -2 -5
1
c =
0.5000 0 -0.6667 -5.0000
Comments
Post a Comment