Skip to content

Instantly share code, notes, and snippets.

@Idorobots
Created March 12, 2013 22:40
Show Gist options
  • Save Idorobots/5147755 to your computer and use it in GitHub Desktop.
Save Idorobots/5147755 to your computer and use it in GitHub Desktop.
Matlab fminunc example.
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