You are on page 1of 3

Nama : Andini Pradita Sandy

Stambuk : A 241 17 084

Kelas : C

Tugas 6

BAB 8
4. function y=fungsi_Fx(x)
y=(x-1)./(x.^2+1);
>> figure; fplot('fungsi_Fx',[-10 10]);

>> nol_1=fzero('fungsi_Fx',0)

nol_1 =

>> min_1=fminbnd('fungsi_Fx',-2,2)

min_1 =

-0.4142

>> max_1=fminbnd('minus_Fx',0,6)

max_1 =

2.4142

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1

-1.2

-1.4
-10 -8 -6 -4 -2 0 2 4 6 8 10
5. function z=fungsi_Gxy(x)
z=sin(x(1)).*sin(x(2))+sin(x(1).*x(2));
>> x=linspace(-2,2,50); %menciptakan vektor x
>> %asumsikan y=x
>> for i =1:50 %menghitung Gxy pada setiap titik
for j=1:50
z(i,j)=fungsi_Gxy([x(i) x(j)]);
end
end
>> meshc(x,x,z); %plot grafik 3-D plus kontur

1.5

0.5

-0.5

-1

-1.5

-2
2

1 2
1.5
1
0 0.5
0
-1 -0.5
-1
-1.5
-2 -2

>> min_1=fminsearch('fungsi_Gxy',[1,-1])

min_1 =

1.3233 -1.3233

>> min_2=fminsearch('fungsi_Gxy',[-1,1])

min_2 =

-1.3233 1.3233

>> max_1=fminsearch('minus_Gxy',[1,1])
max_1 =

1.3233 1.3233

>> max_2=fminsearch('minus_Gxy',[-1,-1])

max_2 =

-1.3233 -1.3233

BAB 9
1. >> x=linspace(-10,10,200); %metode trapezoid

>> y=sqrt(100-x.^2);

>> int_trap=trapz(x,y)

int_trap =

157.0204

function y=fungsi_01(x)
y=sqrt(100-x.^2);

>> int_quad=quad('fungsi_01',-10,10)

int_quad =

157.0796

3. function w=fungsi_03(x,y,z)
w=x.^2+x.*y+y.*z+z.^2;
>> int_3=triplequad('fungsi_03',-1,1,-1,1,-1,1)

int_3 =

5.3333

You might also like