Anda di halaman 1dari 48

TUGAS INDIVIDU 1

PIRANTI LUNAK TELEKOMUNIKASI

OLEH
DWI YOGA PRATAMA (1404405014)

UNIVERSITAS UDAYANA
FAKULTAS TEKNIK
JURUSAN TEKNIK ELEKTRO DAN KOMPUTER
2016
1. Practice 2.3

Gambar 1 Soal Practice 2.3


Jawaban:

a).
>> 2^5/(2^6 - 1)

ans =

0.5079

Gambar 1.a Hasil Matlab

b).
>> exp(4)

ans =

54.5982
Gambar 1.b Hasil Matlab

c).
>> log(exp(4))

ans =

Gambar 1.c Hasil Matlab

d).
>> log10(exp(4))

ans =

1.7372

Gambar 1.d Hasil Matlab

e).
>> exp(sqrt(121))

ans =

5.9874e+04

Gambar 1.e Hasil Matlab


f).
>> cos(pi/4)+(sin(pi/3)*sin(pi/3))

ans =

1.4571

Gambar 1.f Hasil Matlab

g).
>> log(exp(3))+log10(exp(1))

ans =

3.4343

Gambar 1.g Hasil Matlab

h).
>> area=pi*((pi/3)^2)

area =

3.4451

Gambar 1.h Hasil Matlab


2. Practice 2.4

Gambar 2 Soal
Jawaban:
a).
>> solve 2^x=7

ans =

log(7)/log(2)

>> ans

ans =

log(7)/log(2)

>> log(7)/log(2)

ans =

2.8074

Gambar 2.a Hasil Matlab


b).
>> solve log(x)=3

ans =

exp(3)

>> exp(3)

ans =

20.0855

Gambar 2.b Hasil Matlab


c).
>> solve exp(x)=10

ans =

log(10)

>> log(10)

ans =

2.3026
Gambar 2.c Hasil Matlab
d).
>> solve sqrt((3^(1/3))*(9^(1/3)))=(1/3)^x

ans =

-1/2

Gambar 2.d Hasil Matlab

e).
>> solve sqrt(2)/6^3=3^x

ans =

-log(108*2^(1/2))/log(3)

>> -log(108*2^(1/2))/log(3)

ans =

-4.5773

Gambar 2.e Hasil Matlab


3. Practice 2.25

Gambar 3 Soal

Jawaban:

>> t11=1; t12=1; t21=2; t22=4; t31=3; t32=2;


>> jarak_dari_t1t2 = sqrt((t11 - t21)^2) + ((t12 - t22)^2)

jarak_dari_t1t2 =

10

>> jarak_dari_t1t3 = sqrt((t11 - t31)^2) + ((t12 - t32)^2)

jarak_dari_t1t3 =

>> jarak_dari_t2t3 = sqrt((t21 - t31)^2) + ((t22 - t32)^2)

jarak_dari_t2t3 =

>> spm = 1/2*(jarak_dari_t1t2+ jarak_dari_t1t3+ jarak_dari_t2t3)

spm =

>> lss=sqrt(spm*(spm-jarak_dari_t1t2)*(spm-jarak_dari_t1t3)*(spm-
jarak_dari_t2t3))

lss =

0.0000 +14.6969i
Gambar 3 Hasil Matlab
4. Practice 2.26

Gambar 4 Soal

Jawaban:
a).
>> t00=5; t01=-1;
>> t10=3; t11=2;
>> distance = sqrt((t00-t10)^2+(t01-t11)^2)

distance =

3.6056

>> slope=(t11-t01)/(t10-t00)

slope =

-1.5000

Gambar 4.a Hasil Matlab

b).
>> t00=8; t01=1;
>> u10=9; u11=0;
>> distance = sqrt((u00-u10)^2+(u01-u11)^2)

distance =
1.4142

>> slope=(u11-u01)/(u10-u00)

slope =

-1

Gambar 4.b Hasil Matlab

c).
>> a00=5; a01=3;
>> a10=-1; a11=7;
>> distance = sqrt((a00-a10)^2+(a01-a11)^2)

distance =

7.211102550927978

>> slope=(a11-a01)/(a10-a00)

slope =

-0.666666666666667
Gambar 4.c Hasil Matlab

5. Practice 2.37

Gambar 5 Soal

>> n=[30 40 70];


>> 227*exp(0.007*n)

ans =

280.0449 300.3505 370.5358

Gambar 5 Hasil Matlab


6. Practice 3.2

Gambar 6 Soal
>> x=[1:10];
a).
>> ans_a=x-x

ans_a=

0 0 0 0 0 0 0 0 0 0

Gambar 6.a Hasil Matlab

b).
>> ans_b=x.^x

ans_b =

1.0e+10 *

0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001


0.0017 0.0387 1.0000
Gambar 6.b Hasil Matlab

c).
>> ans_c=x.*x

ans_c =

1 4 9 16 25 36 49 64 81 100

Gambar 6.c Hasil Matlab

d).
>> ans_d=x*x'

ans_d =

385

Gambar 6.d Hasil Matlab


e).
>> ans_e=x'*x

ans_e =

1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
3 6 9 12 15 18 21 24 27 30
4 8 12 16 20 24 28 32 36 40
5 10 15 20 25 30 35 40 45 50
6 12 18 24 30 36 42 48 54 60
7 14 21 28 35 42 49 56 63 70
8 16 24 32 40 48 56 64 72 80
9 18 27 36 45 54 63 72 81 90
10 20 30 40 50 60 70 80 90 100

Gambar 6.e Hasil Matlab

f).
>> ans_f=x.\x

ans_f =

1 1 1 1 1 1 1 1 1 1

Gambar 6.f Hasil Matlab


g).
>> ans_g=x./x

ans_g =

1 1 1 1 1 1 1 1 1 1

Gambar 6.g Hasil Matlab

h).
>> x = 'x', ans_h = x

x =

ans_h =

Gambar 6.h Hasil Matlab


7. R.3.63

Gambar 7 Soal
Jawaban:
>> MARK = [0 1 ; 1 0]

MARK =

0 1
1 0

>> MARK'*MARK

ans =

1 0
0 1

>> MARK*MARK'

ans =

1 0
0 1

>> inv(MARK)

ans =

0 1
1 0

>> orth(MARK)

ans =

0 -1
-1 0
Gambar 7.a Hasil Coding pada Matlab
8. R.3.64

Gambar 8 Soal

Jawaban:
>> X=[cosd(0) -sind(0); sind(0) cosd(0)]

X =

1 0
0 1

>> X'

ans =

1 0
0 1

>> inv(X)

ans =

1 0
0 1

Matriks ini orthogonal karena X=inv(X)


Gambar 8a. Hasil coding pada Matlab

>> X=[cosd(180) -sind(180); sind(180) cosd(180)]

X =

-1 0
0 -1

>> X'

ans =

-1 0
0 -1

>> inv(X)

ans =

-1 0
0 -1
Matriks ini orthogonal karena X=inv(X)
Gambar 8b. Hasil coding pada Matlab

>> X=[cosd(2*180) -sind(2*180); sind(2*180) cosd(2*180)]

X =

1 0
0 1

>> X'

ans =

1 0
0 1

>> inv(X)

ans =

1 0
0 1

Matriks ini orthogonal karena X=inv(X)


Gambar 8c. Hasil coding pada Matlab

>> X=[cosd(3*180) -sind(3*180); sind(3*180) cosd(3*180)]

X =

-1 0
0 -1

>> X'

ans =

-1 0
0 -1

>> inv(X)

ans =

-1 0
0 -1

Matriks ini orthogonal karena X=inv(X)


Gambar 8d. Hasil coding pada Matlab

>> X=[cosd(4*180) -sind(4*180); sind(4*180) cosd(4*180)]

X =

1 0
0 1

>> X'

ans =

1 0
0 1

>> inv(X)

ans =

1 0
0 1

Matriks ini orthogonal karena X=inv(X)


Gambar 8e. Hasil coding pada Matlab
9. R.5.18

Gambar 9 Soal

Untuk point = 3
>> x1=linspace(-5,2,3)

x1 =

-5.0000 -1.5000 2.0000

>> y1=x1.^3+4*x1.^2-x1-4

y1 =

-24.0000 3.1250 18.0000

Gambar 9.a Hasil Matlab

Untuk point = 4
>> x2=linspace(-5,2,4)

x2 =

-5.0000 -2.6667 -0.3333 2.0000

>> y2=x2.^3+4*x2.^2-x2-4

y2 =

-24.0000 8.1481 -3.2593 18.0000


Gambar 9.b Hasil Matlab

Untuk point = 5
>> x3=linspace(-5,2,5)

x3 =

-5.0000 -3.2500 -1.5000 0.2500 2.0000

>> y3=x3.^3+4*x3.^2-x3-4

y3 =

-24.0000 7.1719 3.1250 -3.9844 18.0000

Gambar 9.c Hasil Matlab

Untuk point = 6
>> x4=linspace(-5,2,6)

x4 =

-5.0000 -3.6000 -2.2000 -0.8000 0.6000 2.0000

>> y4=x4.^3+4*x4.^2-x4-4

y4 =
-24.0000 4.7840 6.9120 -1.1520 -2.9440 18.0000

Gambar 9.d Hasil Matlab

Untuk point = 7
>> x5=linspace(-5,2,7)

x5 =

-5.0000 -3.8333 -2.6667 -1.5000 -0.3333 0.8333 2.0000

>> y5=x5.^3+4*x5.^2-x5-4

y5 =

-24.0000 2.2824 8.1481 3.1250 -3.2593 -1.4769 18.0000

Gambar 9.e Hasil Matlab

Untuk point = 101


>> x6=linspace(-5,2,101)

x6 =

Columns 1 through 12

-5.0000 -4.9300 -4.8600 -4.7900 -4.7200 -4.6500 -4.5800


-4.5100 -4.4400 -4.3700 -4.3000 -4.2300

Columns 13 through 24
-4.1600 -4.0900 -4.0200 -3.9500 -3.8800 -3.8100 -3.7400
-3.6700 -3.6000 -3.5300 -3.4600 -3.3900

Columns 25 through 36

-3.3200 -3.2500 -3.1800 -3.1100 -3.0400 -2.9700 -2.9000


-2.8300 -2.7600 -2.6900 -2.6200 -2.5500

Columns 37 through 48

-2.4800 -2.4100 -2.3400 -2.2700 -2.2000 -2.1300 -2.0600


-1.9900 -1.9200 -1.8500 -1.7800 -1.7100

Columns 49 through 60

-1.6400 -1.5700 -1.5000 -1.4300 -1.3600 -1.2900 -1.2200


-1.1500 -1.0800 -1.0100 -0.9400 -0.8700

Columns 61 through 72

-0.8000 -0.7300 -0.6600 -0.5900 -0.5200 -0.4500 -0.3800


-0.3100 -0.2400 -0.1700 -0.1000 -0.0300

Columns 73 through 84

0.0400 0.1100 0.1800 0.2500 0.3200 0.3900 0.4600


0.5300 0.6000 0.6700 0.7400 0.8100

Columns 85 through 96

0.8800 0.9500 1.0200 1.0900 1.1600 1.2300 1.3000


1.3700 1.4400 1.5100 1.5800 1.6500

Columns 97 through 101

1.7200 1.7900 1.8600 1.9300 2.0000

>> y6=x6.^3+4*x6.^2-x6-4

y6 =

Columns 1 through 12

-24.0000 -21.6736 -19.4529 -17.3358 -15.3204 -13.4046 -11.5863


-9.8635 -8.2340 -6.6959 -5.2470 -3.8854

Columns 13 through 24

-2.6089 -1.4155 -0.3032 0.7301 1.6865 2.5681 3.3768


4.1147 4.7840 5.3866 5.9247 6.4002

Columns 25 through 36

6.8152 7.1719 7.4722 7.7182 7.9119 8.0555 8.1510


8.2004 8.2058 8.1693 8.0929 7.9786
Columns 37 through 48

7.8286 7.6449 7.4295 7.1845 6.9120 6.6140 6.2926


5.9498 5.5877 5.2084 4.8138 4.4062

Columns 49 through 60

3.9875 3.5597 3.1250 2.6854 2.2429 1.7997 1.3578


0.9191 0.4859 0.0601 -0.3562 -0.7609

Columns 61 through 72

-1.1520 -1.5274 -1.8851 -2.2230 -2.5390 -2.8311 -3.0973


-3.3354 -3.5434 -3.7193 -3.8610 -3.9664

Columns 73 through 84

-4.0335 -4.0603 -4.0446 -3.9844 -3.8776 -3.7223 -3.5163


-3.2575 -2.9440 -2.5736 -2.1444 -1.6542

Columns 85 through 96

-1.1009 -0.4826 0.2028 0.9574 1.7833 2.6825 3.6570


4.7090 5.8404 7.0534 8.3499 9.7321

Columns 97 through 101

11.2020 12.7617 14.4133 16.1587 18.0000


Gambar 9.f Hasil Matlab
Gambar 9.g Grafik Hasil Plot pada Matlab
10. R.5.19

Gambar 10 Soal

Jawaban:
>> x1 = linspace (0,2,5)

x1 =

0 0.5000 1.0000 1.5000 2.0000

>> a = x1*pi

a =

0 1.5708 3.1416 4.7124 6.2832

>> x2 = linspace (0,2,10)

x2 =

0 0.2222 0.4444 0.6667 0.8889 1.1111 1.3333


1.5556 1.7778 2.0000

>> b = x2*pi

b =

0 0.6981 1.3963 2.0944 2.7925 3.4907 4.1888


4.8869 5.5851 6.2832

>> x3 = linspace(0,2,15)

x3 =

Columns 1 through 12

0 0.1429 0.2857 0.4286 0.5714 0.7143 0.8571


1.0000 1.1429 1.2857 1.4286 1.5714

Columns 13 through 15

1.7143 1.8571 2.0000

>> c = x3*pi

c =

Columns 1 through 12

0 0.4488 0.8976 1.3464 1.7952 2.2440 2.6928


3.1416 3.5904 4.0392 4.4880 4.9368
Columns 13 through 15

5.3856 5.8344 6.2832

>> x4 = linspace(0,2,20)

x4 =

Columns 1 through 12

0 0.1053 0.2105 0.3158 0.4211 0.5263 0.6316


0.7368 0.8421 0.9474 1.0526 1.1579

Columns 13 through 20

1.2632 1.3684 1.4737 1.5789 1.6842 1.7895 1.8947


2.0000

>> d = x4*pi

d =

Columns 1 through 12

0 0.3307 0.6614 0.9921 1.3228 1.6535 1.9842


2.3149 2.6456 2.9762 3.3069 3.6376

Columns 13 through 20

3.9683 4.2990 4.6297 4.9604 5.2911 5.6218 5.9525


6.2832

>> y1 = 1.5*cos(2*a)

y1 =

1.5000 -1.5000 1.5000 -1.5000 1.5000

>> y2 = 1.5*cos(2*b)

y2 =

1.5000 0.2605 -1.4095 -0.7500 1.1491 1.1491 -0.7500


-1.4095 0.2605 1.5000

>> y3 = 1.5*cos(2*c)

y3 =

Columns 1 through 12

1.5000 0.9352 -0.3338 -1.3515 -1.3515 -0.3338 0.9352


1.5000 0.9352 -0.3338 -1.3515 -1.3515

Columns 13 through 15

-0.3338 0.9352 1.5000


>> y4 = 1.5*cos(2*d)

y4 =

Columns 1 through 12

1.5000 1.1837 0.3682 -0.6025 -1.3192 -1.4795 -1.0159


-0.1239 0.8204 1.4187 1.4187 0.8204

Columns 13 through 20

-0.1239 -1.0159 -1.4795 -1.3192 -0.6025 0.3682 1.1837


1.5000

>> plot (a,y1,'c-*',b,y2,'b-^',c,y3,'r-o',d,y4,'g-+')


>> grid on
Gambar 10.a Hasil Matlab
Gambar 10.b Grafik hasil plot pada Matlab
11. R.5.73

Gambar 11 Soal

Jawaban:
>> x = [-2:0.4:2]*pi

x =

-6.2832 -5.0265 -3.7699 -2.5133 -1.2566 0 1.2566


2.5133 3.7699 5.0265 6.2832

>> y1 = sin(x)

y1 =

0.0000 0.9511 0.5878 -0.5878 -0.9511 0 0.9511


0.5878 -0.5878 -0.9511 -0.0000

>> y2 = sind(x)/x

y2 =

0.0174

>> plot(x,y1,'r-*',x,y2,'b-^')
>> ylabel('variabel y bebas')
>>
>> xlabel ('variabel x bebas')
>> grid on
Gambar 11.a Hasil pada Matlab

Gambar 11.b Grafik hasil plot pada Matlab


12. R.5.46

Gambar 12 Soal
Jawaban:
>> noice= rand(1,100)

noice =

Columns 1 through 12

0.8147 0.9058 0.1270 0.9134 0.6324 0.0975 0.2785


0.5469 0.9575 0.9649 0.1576 0.9706

Columns 13 through 24

0.9572 0.4854 0.8003 0.1419 0.4218 0.9157 0.7922


0.9595 0.6557 0.0357 0.8491 0.9340

Columns 25 through 36

0.6787 0.7577 0.7431 0.3922 0.6555 0.1712 0.7060


0.0318 0.2769 0.0462 0.0971 0.8235

Columns 37 through 48

0.6948 0.3171 0.9502 0.0344 0.4387 0.3816 0.7655


0.7952 0.1869 0.4898 0.4456 0.6463

Columns 49 through 60

0.7094 0.7547 0.2760 0.6797 0.6551 0.1626 0.1190


0.4984 0.9597 0.3404 0.5853 0.2238

Columns 61 through 72

0.7513 0.2551 0.5060 0.6991 0.8909 0.9593 0.5472


0.1386 0.1493 0.2575 0.8407 0.2543

Columns 73 through 84

0.8143 0.2435 0.9293 0.3500 0.1966 0.2511 0.6160


0.4733 0.3517 0.8308 0.5853 0.5497

Columns 85 through 96

0.9172 0.2858 0.7572 0.7537 0.3804 0.5678 0.0759


0.0540 0.5308 0.7792 0.9340 0.1299
Columns 97 through 100

0.5688 0.4694 0.0119 0.3371

>> x=linspace(0,3,100)

x =

Columns 1 through 12

0 0.0303 0.0606 0.0909 0.1212 0.1515 0.1818


0.2121 0.2424 0.2727 0.3030 0.3333

Columns 13 through 24

0.3636 0.3939 0.4242 0.4545 0.4848 0.5152 0.5455


0.5758 0.6061 0.6364 0.6667 0.6970

Columns 25 through 36

0.7273 0.7576 0.7879 0.8182 0.8485 0.8788 0.9091


0.9394 0.9697 1.0000 1.0303 1.0606

Columns 37 through 48

1.0909 1.1212 1.1515 1.1818 1.2121 1.2424 1.2727


1.3030 1.3333 1.3636 1.3939 1.4242

Columns 49 through 60

1.4545 1.4848 1.5152 1.5455 1.5758 1.6061 1.6364


1.6667 1.6970 1.7273 1.7576 1.7879

Columns 61 through 72

1.8182 1.8485 1.8788 1.9091 1.9394 1.9697 2.0000


2.0303 2.0606 2.0909 2.1212 2.1515

Columns 73 through 84

2.1818 2.2121 2.2424 2.2727 2.3030 2.3333 2.3636


2.3939 2.4242 2.4545 2.4848 2.5152

Columns 85 through 96

2.5455 2.5758 2.6061 2.6364 2.6667 2.6970 2.7273


2.7576 2.7879 2.8182 2.8485 2.8788

Columns 97 through 100

2.9091 2.9394 2.9697 3.0000

>> x1=x*pi

x1 =

Columns 1 through 12
0 0.0952 0.1904 0.2856 0.3808 0.4760 0.5712
0.6664 0.7616 0.8568 0.9520 1.0472

Columns 13 through 24

1.1424 1.2376 1.3328 1.4280 1.5232 1.6184 1.7136


1.8088 1.9040 1.9992 2.0944 2.1896

Columns 25 through 36

2.2848 2.3800 2.4752 2.5704 2.6656 2.7608 2.8560


2.9512 3.0464 3.1416 3.2368 3.3320

Columns 37 through 48

3.4272 3.5224 3.6176 3.7128 3.8080 3.9032 3.9984


4.0936 4.1888 4.2840 4.3792 4.4744

Columns 49 through 60

4.5696 4.6648 4.7600 4.8552 4.9504 5.0456 5.1408


5.2360 5.3312 5.4264 5.5216 5.6168

Columns 61 through 72

5.7120 5.8072 5.9024 5.9976 6.0928 6.1880 6.2832


6.3784 6.4736 6.5688 6.6640 6.7592

Columns 73 through 84

6.8544 6.9496 7.0448 7.1400 7.2352 7.3304 7.4256


7.5208 7.6160 7.7112 7.8064 7.9016

Columns 85 through 96

7.9968 8.0920 8.1872 8.2824 8.3776 8.4728 8.5680


8.6632 8.7584 8.8536 8.9488 9.0440

Columns 97 through 100

9.1392 9.2344 9.3296 9.4248

>> y1=10*sin(x1)

y1 =

Columns 1 through 12

0 0.9506 1.8925 2.8173 3.7166 4.5823 5.4064


6.1816 6.9008 7.5575 8.1458 8.6603

Columns 13 through 24

9.0963 9.4500 9.7181 9.8982 9.9887 9.9887 9.8982


9.7181 9.4500 9.0963 8.6603 8.1458
Columns 25 through 36

7.5575 6.9008 6.1816 5.4064 4.5823 3.7166 2.8173


1.8925 0.9506 0.0000 -0.9506 -1.8925

Columns 37 through 48

-2.8173 -3.7166 -4.5823 -5.4064 -6.1816 -6.9008 -7.5575


-8.1458 -8.6603 -9.0963 -9.4500 -9.7181

Columns 49 through 60

-9.8982 -9.9887 -9.9887 -9.8982 -9.7181 -9.4500 -9.0963


-8.6603 -8.1458 -7.5575 -6.9008 -6.1816

Columns 61 through 72

-5.4064 -4.5823 -3.7166 -2.8173 -1.8925 -0.9506 -0.0000


0.9506 1.8925 2.8173 3.7166 4.5823

Columns 73 through 84

5.4064 6.1816 6.9008 7.5575 8.1458 8.6603 9.0963


9.4500 9.7181 9.8982 9.9887 9.9887

Columns 85 through 96

9.8982 9.7181 9.4500 9.0963 8.6603 8.1458 7.5575


6.9008 6.1816 5.4064 4.5823 3.7166

Columns 97 through 100

2.8173 1.8925 0.9506 0.0000

>> y2=(2*cos(x1))+noice

y2 =

Columns 1 through 12

2.8147 2.8967 2.0908 2.8324 2.4891 1.8752 1.9610


2.1190 2.4050 2.2746 1.3177 1.9706

Columns 13 through 24

1.7880 1.1395 1.2718 0.4265 0.5169 0.8206 0.5076


0.4880 0.0016 -0.7951 -0.1509 -0.2261

Columns 25 through 36

-0.6310 -0.6897 -0.8290 -1.2903 -1.1222 -1.6855 -1.2129


-1.9320 -1.7140 -1.9538 -1.8938 -1.1404

Columns 37 through 48

-1.2242 -1.5396 -0.8274 -1.6481 -1.1334 -1.0659 -0.5442


-0.3649 -0.8131 -0.3411 -0.2085 0.1748
Columns 49 through 60

0.4247 0.6595 0.3712 0.9643 1.1266 0.8167 0.9498


1.4984 2.1199 1.6501 2.0327 1.7959

Columns 61 through 72

2.4338 2.0328 2.3627 2.6181 2.8548 2.9502 2.5472


2.1296 2.1132 2.1765 2.6975 2.0320

Columns 73 through 84

2.4968 1.8156 2.3767 1.6597 1.3567 1.2511 1.4469


1.1274 0.8232 1.1155 0.6804 0.4546

Columns 85 through 96

0.6326 -0.1857 0.1031 -0.0771 -0.6196 -0.5923 -1.2339


-1.3935 -1.0413 -0.9033 -0.8437 -1.7268

Columns 97 through 100

-1.3502 -1.4945 -1.9790 -1.6629


>> plot(x1,y1,'r',x1,y2,'g')
Gambar 12.a Hasil coding pada Matlab

Gambar 12.b Grafik hasil plot pada Matlab

Anda mungkin juga menyukai