I am getting an error message 'not enough input arguments' on running Rosenbrock's function using the optimization tool box solver 'fmincon' solver. How to correct it?

 採用された回答

Torsten
Torsten 2015 年 5 月 28 日
Your optimization toolbox guide and your MATLAB version are compatible ?
Best wishes
Torsten.

1 件のコメント

Yes...I went through the documentation from the toolbox help menu.

サインインしてコメントする。

その他の回答 (3 件)

Alan Weiss
Alan Weiss 2015 年 5 月 28 日
For more help, please show us your exact Rosenbrock function, your exact and full fmincon call, and the exact output that you received.
Alan Weiss
MATLAB mathematical toolbox documentation
shilpa suresh
shilpa suresh 2015 年 5 月 29 日
%unitdisk.m
function [c, ceq] = unitdisk(x)
c = x(1)^2 + x(2)^2 - 1;
ceq = [ ];
end
%vrosenbrock.m
function z=vrosenbrock(x,y)
z=100*(y - x.^2).^2 + (1-x).^2; end
This is what I am getting..
As objective function, use
function z = vrosenbrock(x)
z = 100*(x(2) - x(1)^2)^2 + (1 - x(1))^2;
Best wishes
Torsten.

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by