How can i fix this error ? Failure in initial user-supplied objective function evaluation. FMINUNC cannot continue.

f = @(x1,x2) (1 + (x1 + x2 + 1).^2.*(19 - 14*x1 + 3*x1.^2 - 14*x2 + 6*x1.*x2 + 3*x2.^2)).*...
(30 + (2*x1 - 3*x2).^2.*(18 - 32*x1 + 12*x1.^2 + 48*x2 - 36*x1.*x2 + 27*x2.^2));
x0=[1,1];
[x,fval] = fminunc(f,x0)

 采纳的回答

f=@(x)(1 + (x(1) + x(2) + 1).^2.*(19 - 14*x(1) + 3*x(1).^2 - 14*x(2) + 6*x(1).*x(2) + 3*x(2).^2)).*...
(30 + (2*x(1) - 3*x(2)).^2.*(18 - 32*x(1) + 12*x(1).^2 + 48*x(2) - 36*x(1).*x(2) + 27*x(2).^2));
Best wishes
Torsten.

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by