How to separate symbolic equation coefficients

13 次查看(过去 30 天)
Hi All,
Lets say that I have a symbolic term L=Ax+By not in vector form. How do I, get the term that multiplies x and y i.e. Q=A,W=B without retyping the equation?
Thanks!
Gil,

回答(1 个)

Andrei Bobrov
Andrei Bobrov 2017-5-23
编辑:Andrei Bobrov 2017-5-23
syms A B x y
L = A*x + B*y;
out = coeffs(L,[x,y])

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by