Getting the coefficients of a function in Matlab syms
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
How would I be able to get the Coefficients of the f function down below and get the Expected Output?
Code:
syms a b
f = expand((a+b)^2)
Expected Output:
1 2 1
0 Kommentare
Antworten (1)
DGM
am 15 Nov. 2021
Try
syms a b
f = expand((a+b)^2)
c = coeffs(f) % if you want a symbolic result
c = double(c) % if you want a numeric result
0 Kommentare
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!