How to extract terms from polynomial in syms
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dear all, I want to extract terms from polynomial formed using syms. Here is the code
smys x a
y= x^4 + a*x^3 + 2*a^2*x + 5;
now i need to extract the terms x^4 a*x^3 etc into a new variable that can be used at some other place. like
w=x^4;
r=a*x^3;
d=w+r;
Kindly help on this thanks.
2 comentarios
Amit
el 2 de En. de 2014
Didn't you answer your own question? Isn't w,r,d are what you want? Am I missing something?
Respuestas (1)
Azzi Abdelmalek
el 2 de En. de 2014
Editada: Azzi Abdelmalek
el 2 de En. de 2014
syms x a
y= x^4 + a*x^3 + 2*a^2*x + 5;
[variable,coefficient]=coeffs(y,x)
0 comentarios
Ver también
Categorías
Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!