非线性方程组建立与求解问题。
Show older comments
小弟在编一个在function里求解非线性方程组的问题,遇到一点不懂的地方求大神指导。
问题简化如下:
function result=fun(n)
equ1='p1=1*(x1+1)^2';
equ2='p2=2*(x1+1)^2+1*(x2+2)^2';
equ3='p3=3*(x1+1)^2+2*(x2+2)^2+1*(x3+3)^2';
equ4='p4=4*(x1+1)^2+3*(x2+2)^2+2*(x3+3)^2+1*(x4+4)^2';
......
equn=..........
result=solve(equ1,equ2,equ3,.....equn)
end
想通过此程序求解p1~pn,x1~xn,由于这里是简化后的问题,方程不封闭这儿不讨论是否可以解出。
小弟想请教,在n很大的情况下,就会有很多方程,像我这样一个一个的输入会很麻烦,solve()内的东西也会很冗长,想请教各位大神,可不可以通过循环或其它方法将该程序简化。
Accepted Answer
More Answers (0)
Categories
Find more on 大型文件和大数据 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!