如何提取非线性方程中的系数?。

最近想要实现对任意带非线性约束的非线性方程的极值,需要把任意已知维数的非线性方程的系数提取出来,请问有什么解决的办法吗?
例如一个简单的二元非线性方程:x+y+xy-2=0,我想要得到的是矩阵[ -2 1 1 1 ],即常数,对x求偏导数的常数部分,对y求偏导数的常数部分和对xy求导数的部分。

 采纳的回答

baeving
baeving 2022-10-28

0 个投票

syms x y
ff=x+y+x*y-2
coeffs(ff)

更多回答(0 个)

类别

标签

Community Treasure Hunt

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

Start Hunting!