Created
March 12, 2013 22:40
-
-
Save Idorobots/5147755 to your computer and use it in GitHub Desktop.
Matlab fminunc example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function zad5() | |
foo = @(x1, x2) 100*(x2 - x1^2)^2 + (sqrt(2) - x1)^2; | |
bar = @(x) foo(x(1), x(2)); | |
X0 = [0; 0]; | |
Ymin = fminunc(bar, X0); | |
Ymin | |
% Ymin = | |
% 1.4142 | |
% 2.0000 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment