Anda di halaman 1dari 15

Soal no 1 :

a. ≫x= linspace (0,400);


>> y=2*sin(x/180*pi);
>> z=-2*sin(x/180*pi)+ cos(x/180*pi);
>> plot(x,y,x,z)

≫ grid on
>> xlabel('Nilai Variabel x')
>> ylabel ('Nilai Vriabel y')
>> title ('Grafik Fungsi y=2sin(x)dan z=-2sin(x)+cos(x)')
>> gtext('y=2sin(x)')
>> gtext ('z=-2sin(x)+cos(x)')

≫ legend ('2sin(x)','-2sin(x)+cos(x)')
Output :
b. ≫fplot('3*(sin(x/180*pi))^2-2*cos(x/180*pi)',[0 400]);
>> grid on
>> hold on
>> fplot('3*(cos(x/180*pi))^2-2*cos(x/180*pi)',[0 400])
>> title('Grafik y=3[sin(x)]^2-2cos(x) dan z=3[cos(x)]^2-2cos(x)')
>> xlabel('Nilai variabel X')
>> ylabel ('Nilai variabel Y')
>> gtext('y=3[sin(x)]^2-2cos(x)')
>> gtext('z=3[cos(x)^2-2cos(x)')
>> title ('grafik y=3[sin(x)]^2-2cos(x) dan z=3[cos(x)]^2-2cos(x)')
>> legend ('3[sin(x)]^2-2cos(x)','3[cos(x)]^2-2cos(x)')
Output :
c.
d. >> x=-1:0.1:1;
>> y=x;
>> [xi yi]=meshgrid(x,y);
>> zi=2*xi.^2-3*yi.^2;
>> surfc(xi,yi,zi)
>> meshc(xi,yi,zi)
>> title('Menggambar grafik')
>> xlabel('Sumbu x')
>> ylabel('sumbu y')
>> zlabel('sumbu z')
Output :

e. >> syms x
>> f=exp(x)-2*x^2;
>> ezplot(f,[-1 3])
>> grid on
>> gtext ('f=exp(x)-2x^2')
>> title('Grafik Fungsi f(x)=exp(x)-2x^2')
>> legend ('exp(x)-2x^2')
Output :
f. >> syms x
>> f= 3*exp(-x/2)*sin(5*x);
>> ezplot(f,[-2*pi 2*pi])
>> grid on
>> title ('Grafik f(x)=3exp(-x/2)sin(5x)')
>> xlabel('sumbu x')
>> ylabel ('sumbu y')
>> legend (f= 3exp(-x/2)sin(5x))
Output :
g. >> x=0:0.01:2*pi;
>> polar(x,sin(2*x).*cos(x)+1)
Output :

Soal No 2
A. Selesaikan SPL berikut dengan menggunakan Matlab:
2x1 + 3x2 + 4x3 – 5x4 + x5 = (*)
x1 – (*)x2 + x3 – 4x4 + x5 = 6
–x1 + x2 – 4x3 + 2x4 – x5 = 8
2x1 + 3x2 + x3 – 5x4 – x5 = (*)
3x1 + x2 – 2x3 – (*)x4 + x5 = 4
Catatan:
Tanda (*) diganti satu angka terakhir dari nomor NPM, kecuali yang angka terakhirnya 0
(nol) diganti dengan 1 (satu).
Penyelesaian :
1. Lydia Hunaidah (NPM : 112070263)
>> A=[2 3 4 -5 1;1 -3 1 -4 1;-1 1 -4 2 -1; 2 3 1 -5 -1; 3 1 -2 -3 1]

A=

2 3 4 -5 1
1 -3 1 -4 1
-1 1 -4 2 -1
2 3 1 -5 -1
3 1 -2 -3 1
>> B=[3;6;8;3;4]

B=

3
6
8
3
4
>> C=inv(A)

C=

-0.4728 -0.3315 -0.6793 0.2446 0.3696


0.2418 -0.1005 0.2038 -0.0734 -0.0109
-0.0489 -0.1033 -0.2772 0.0598 -0.0652
-0.1685 -0.2446 -0.2880 -0.0163 0.1087
0.5734 0.1549 0.4158 -0.5897 0.0978

>> X=C*B

X=

-6.6304
1.4891
-3.0652
-3.8913
4.5978
2. Immarotulamalia (NPM : )

3. Juheri (NPM : )
4. Umar Soleh (NPM :)
5. Moch. Darojat (NPM :112070131)
>>A=[2 3 4 -5 1;1 -1 1 -4 1;-1 1 4 2 -1;2 3 1 -5 -1;3 1 2 -1 1]

A=

2 3 4 -5 1
1 -1 1 -4 1
-1 1 4 2 -1
2 3 1 -5 -1
3 1 2 -1 1

>> B=[1;6;8;1;4]

B=

1
6
8
1
4
>>C=inv(A)
C=

-0.2802 0.0628 0.0242 0.1594 0.4010


0.3213 -0.4082 -0.1570 -0.0362 -0.1063
-0.0097 0.1401 0.2077 -0.0290 0.0483
-0.0242 -0.1498 0.0193 -0.0725 0.1208
0.5145 -0.2101 -0.3116 -0.4565 -0.0725
X=C*B

X=

2.0531
-3.8454
2.6570
-0.3575
-3.9855

B. Manipulasi Matriks
>> A=[9 8 7 6 5; 1 2 3 4 0; -5 -4 -3 -2 -1; -7 -8 -6 -9 10]

A=

9 8 7 6 5
1 2 3 4 0
-5 -4 -3 -2 -1
-7 -8 -6 -9 10

>> b = [1 4]

b=

1 4

>> c= [1 3]

c=

1 3

>> D=A(b,c)

D=

9 7
-7 -6

A=
9 8 7 6 5
1 2 3 4 0
-5 -4 -3 -2 -1
-7 -8 -6 -9 10

>> E=[1 3 4]

E=

1 3 4

>> F=[2 4 5]

F=

2 4 5

>> G=A(E,F)

G=

8 6 5
-4 -2 -1
-8 -9 10

Mochamad Darojat (112070271)

4.A

» syms x y

» f=(x^3+x^2*y+sin(1*x*y))-1

f=

x^3+x^2*y+sin(x*y)-1

» diff(f)

ans =

3*x^2+2*x*y+cos(x*y)*y

4.C
Mochamad Darojat (112070131)

» syms x

» A=1*x/(sqrt(x.^2+4*x+1)-sqrt(x.^2+6*x+1))
A=

x/((x^2+4*x+1)^(1/2)-(x^2+6*x+1)^(1/2))

» limit(f,0)

ans =

4.F

Mochamad Darojat (112070131)

» syms x

» f=('cos(x)*cos(x)-1*exp(x)')

f=

cos(x)*cos(x)-1*exp(x)

» int(f,0,2*pi)

ans =

pi-exp(2*pi)+1

4.G

Mochamad Darojat (112070131)

» syms x

» f=sqrt(x)*(x-1/sqrt(x)-3)

f=
x^(1/2)*(x-1/x^(1/2)-3)

» int(f,0,3)

ans =

-3-12/5*3^(1/2)

4.H

Mochamad Darojat (112070131)

» syms x

» f= 1+(cos(x))^5

f=

1+cos(x)^5

» int(f,0,pi)

ans =

1*pi

4.I

Mochamad Darojat (112070271)

» syms x

» A=1/sqrt(pi)

A=

0.5642
» f=exp(-x).^2

f=

exp(-x)^2

» B=int(f,-1,1)

B=

-1/2*exp(-1)^2+1/2*exp(1)^2

» A*B

ans =

-5081767996463981/18014398509481984*exp(-
1)^2+5081767996463981/18014398509481984*exp(1)^2
SOAL 3:
Diketahui fungsi polynomial : f(x) = x5 – 10x4 – 22x3 + 304x2 – 75x – 1350
Tentukan akar-akar polynomial dan gambarkan grafik fungsinya pada interval [–6 10] step
0.1
Penyelesaian :
Akar-akar Polynomial :
>> f=[1 -10 -22 304 -75 -1350];
>> r=roots (f)
r=
9.0000
-5.0000
5.0000
3.0000
-2.0000
Gambar Grafik Fungsi pada interval [-6 10] step 0,1
>> fplot('x^5-10*x^4-22*x^3+304*x^2-75*x-1350',[-6 10]);
>> grid on
>> xlabel ('sumbu X')
>> ylabel ('sumbu Y')
>> title('Grafik Fungsi Polynomial f(x)=x^5-10x^4-22x^3+304x^2-75x-1350')
>> legend ('x^5-10x^4-22x^3+304x^2-75x-1350')
Output :
SOAL 4:

dy
a) dari x3 + x2y + sin((*)xy) – 1 = 0
dx

Penyelesaian :
Lydia Hunaidah (NPM : 112070263)
>> F=x^3+x^2*y+sin((3*x*y))-1;
>> Fx=diff(F,x)
Fx =
3*x^2+2*x*y+3*cos(3*x*y)*y
>> Fy=diff(F,y)
Fy =
x^2+3*cos(3*x*y)*x
>> dydx=-(Fx/Fy)
dydx =
-(3*x^2+2*x*y+3*cos(3*x*y)*y)/(x^2+3*cos(3*x*y)*x)
dy
b) dari y = x3 + ln(x2) + esin(x) – 1
dx

Penyelesaian :
>> y=x^3+log(x^2)+exp(sin(x))-1

y=

x^3+log(x^2)+exp(sin(x))-1

>> dydx=diff(y)

dydx =

3*x^2+2/x+cos(x)*exp(sin(x))

c) Lim
Penyelesaian :

d) 2x + 3x + 4x + 5x = 50. Nilai x = ?

Penyelesaian :
>> solve('2^x+3^x+4^x+5^x=50')

ans =
1.9445641666712620401924455872631

>> double(ans)

ans =

1.9446
e)

f) A. Lydia Hunaidah (NPM 112070263)


>> f=(cos(x))^2-3*exp(x)

f=

cos(x)^2-3*exp(x)

>> int(f,0,2*pi)

ans =

pi-3*exp(2*pi)+3

g) ---
h) A. Lydia Hunaidah (NPM 112070263)
>> f= 3+(cos(x))^5

f=

3+cos(x)^5

>> int(f,0,pi)

ans =

3*pi

Anda mungkin juga menyukai