You are on page 1of 3

Exercício 2 pag 38

>> syms xy
>> ezsurf(x-y-2,[-8 8 -8 8])
>> hold on
>> ezsurf((-3*x+3*y+16)/2,[-8 8 -8 8])
>> ezsurf(2*x-y-9,[-8 8 -8 8])
>> plot3(7,3,2,'or')
>>

Exercício 3 pag 38

>> syms x
>> ezplot((-2*x+12)/3)
>> hold on
>> ezplot(x+3)
>> plot(0.6,3.6,'or')

Exemplo 2 pag 42

>> A=[10 2 1; 1 5 1;2 3 10]; b=[7 -8 6]';


>> L=tril(A,-1); D=diag(diag(A)); U=triu(A,1);
>> B=-inv(D)*(L+U); d=inv(D)*b;
>> x=[1,2,3]';
>> x=B*x+d

x=

0
-2.4000
-0.2000

>> x=B*x+d

x=

1.2000
-1.5600
1.3200

>> x=B*x+d

x=

0.8800
-2.1040
0.8280

>> x=B*x+d

x=
1.0380
-1.9416
1.0552

>> x=B*x+d

x=

0.9828
-2.0186
0.9749

>> x=B*x+d

x=

1.0062
-1.9915
1.0090

>> x=B*x+d

x=

0.9974
-2.0031
0.9962

>> x=B*x+d

x=

1.0010
-1.9987
1.0014

>> x=B*x+d

x=

0.9996
-2.0005
0.9994

>> x=B*x+d

x=

1.0002
-1.9998
1.0002
>> x=B*x+d

x=

0.9999
-2.0001
0.9999

>> x=B*x+d

x=

1.0000
-2.0000
1.0000

>> x=B*x+d

x=

1.0000
-2.0000
1.0000

>> x=B*x+d

x=

1.0000
-2.0000
1.0000

You might also like