Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc
- clear all
- close all
- x = -5:0.1:5;
- y = -5:0.1:5;
- %f=@(x,y) 2.*x.^2+y.^2+x.*y-6.*x-5.*y+8;
- epsilon = 0.05;
- x0 = 5;
- y0 = 5;
- xprev = 0;
- yprev = 0;
- odlegosc = sqrt(x0 - xprev)^2 + (y0 - yprev)^2;
- while odlegosc > epsilon
- yprev = y0;
- y0 = minY(x0);
- xprev = x0;
- x0 = minX(y0);
- odlegosc = sqrt(x0 - xprev)^2 + (y0 - yprev)^2;
- end
- x0
- y0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement