How to get the coefficients of an equation
Ältere Kommentare anzeigen
Dear all,
Is it possible to extract the coefficients of an equantion defined as below:
syms x1 x2
eq = 2*x1 + x2 <= 0
By using coeffs and sym2poly did not work when it has the relational operator "<=".
c = coeffs(eq)
c = sym2poly(eq)
2 Kommentare
Dyuman Joshi
am 8 Nov. 2023
What is the expected output?
[1 2] or [2 1]? or something else?
Geovane Gomes
am 8 Nov. 2023
Akzeptierte Antwort
Weitere Antworten (1)
Maybe it is appropriate to work in a reverse order, e.g.:
syms x1 x2
Coeff = [2;1];
eq = [x1, x2]*Coeff<=0
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


