blob: ee9e6065de1c14cfc6d84c81698d96fb20a0e5ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
clc;
clear;
function z=u(x,y)
z=x^2+x*y-10
endfunction
function z=v(x,y)
z=y+3*x*y^2-57
endfunction
x=1.5;
y=3.5;
e=[100 100];
while e(1)>0.0001 & e(2)>0.0001
J=[2*x+y x; 3*y^2 1+6*x*y];
deter=determ(J);
u1=u(x,y);
v1=v(x,y);
x=x-((u1*J(2,2)-v1*J(1,2))/deter);
y=y-((v1*J(1,1)-u1*J(2,1))/deter);
e(1)=abs(2-x);
e(2)=abs(3-y);
end
bracket=[x y];
disp(bracket)
|