matlab编程计算下列非线性最小二乘问题
2个回答
展开全部
fun=inline('(1-x(1)*(1-x(2)))^2+(1.5-x(1)*(1-x(2)^2))^2+(1.75-x(1)*(1-x(2)^3))^2','x')
fun =
Inline function:
fun(x) = (1-x(1)*(1-x(2)))^2+(1.5-x(1)*(1-x(2)^2))^2+(1.75-x(1)*(1-x(2)^3))^2
[x,g]=fminsearch(fun,[1,1])
x =
2.0000 0.5000
g =
3.4043e-010
fun =
Inline function:
fun(x) = (1-x(1)*(1-x(2)))^2+(1.5-x(1)*(1-x(2)^2))^2+(1.75-x(1)*(1-x(2)^3))^2
[x,g]=fminsearch(fun,[1,1])
x =
2.0000 0.5000
g =
3.4043e-010
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询