You are on page 1of 4

Nama : Nyoman Agus Nugraha Ginarsa

NIM : 1605541008
Mata Kuliah : Piranti Lunak Telekomunikasi

TUGAS 2
PIRANTI LUNAK TELEKOMUNIKASI

SOAL

JAWABAN
R.5.18
subplot(3,2,1)
x3=linspace(-5,2,3);
y3=x3.^3+4.*x3.^2-x3-4;
plot(x3,y3)
title('Grafik a')
subplot(3,2,2)
x4=linspace(-5,2,4);
y4=x4.^3+4.*x4.^2-x4-4;
plot(x4,y4)
title('Grafik b')
subplot(3,2,3)
x5=linspace(-5,2,5);
y5=x5.^3+4.*x5.^2-x5-4;
plot(x5,y5)
title('Grafik c')
subplot(3,2,4)
x6=linspace(-5,2,6);
y6=x6.^3+4.*x6.^2-x6-4;
plot(x6,y6)
title('Grafik d')
subplot(3,2,5)
x7=linspace(-5,2,7);
y7=x7.^3+4.*x7.^2-x7-4;
plot(x7,y7)
title('Grafik e')
subplot(3,2,6)
x100=linspace(-5,2,101);
y100=x100.^3+4.*x100.^2-x100-4;
plot(x100,y100)
title('Grafik f')
R.5.19
subplot(2,2,1)
x5=linspace(0,2*pi,5); %x5 is defined 5 points, 4 segments
y5=1.5*cos(2.*x5);
plot(x5,y5)
title('Grafik a')
subplot(2,2,2)
x10=linspace(0,2*pi,10); %x10 is defined 10 points, 9 segments
y10=1.5*cos(2.*x10);
plot(x10,y10)
title('Grafik b')
subplot(2,2,3)
x15=linspace(0,2*pi,15); %x15 is defined 15 points, 14 segments
y15=1.5*cos(2.*x15);
plot(x15,y15)
title('Grafik c')
subplot(2,2,4)
x20=linspace(0,2*pi,20); %x20 is defined 20 points, 19 segments
y20=1.5*cos(2.*x20);
plot(x20,y20)
title('Grafik d')
R.5.73
x=-2*pi:0.4:2*pi;
y1=sin(x);
y2=y1.^2./x;
plot(x,y1,':*',x,y2,'s--')
xlabel('x'), ylabel('y')
title('Example using legend, box, grid, labels (x&y), and title')
grid on; box on;
legend ('y1(x)','y2(x)')
text(-4,0.7,'sin(x)')
text(5,0.2,'sin(x)/x')

You might also like