Jawaban Kuis

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

Jawaban Kuis dalpro

1.
>> a=[3 -1; 1 1];
>> b=[0 3; -1 1];
>> c=[1; 2];
>> d=[-4];
>> a.*c
??? Error using ==> times
Matrix dimensions must agree.

>> a*[c c]

ans =

1 1
3 3

>> a.*[c c]

ans =

3 -1
2 2

>> a+b*c
??? Error using ==> plus
Matrix dimensions must agree.

>> a+b.*c
??? Error using ==> times
Matrix dimensions must agree.

2.
>> A=[40 2 2 1 2 50; 60 1 2 2 5 100; 50 5 0.5 0.5 6 50; 35 10 5.5 1.5 4 50; 50 7.5 1.5 1 2
100; 20 5 1 3 5.5 100]

A=

40.0000 2.0000 2.0000 1.0000 2.0000 50.0000


60.0000 1.0000 2.0000 2.0000 5.0000 100.0000
50.0000 5.0000 0.5000 0.5000 6.0000 50.0000
35.0000 10.0000 5.5000 1.5000 4.0000 50.0000
50.0000 7.5000 1.5000 1.0000 2.0000 100.0000
20.0000 5.0000 1.0000 3.0000 5.5000 100.0000

>> K=[10; 25; 15; 45; 60; 38]


Jawaban Kuis dalpro

K=

10
25
15
45
60
38

>> X=A\K

X=

-1.1241
1.0914
8.4905
-29.2269
2.7724
1.1897

3.
>> x=0:0.5:15;
>> y=(2*x.^2)-(10*x)+20;
>> plot(x,y,'o');
>> xlabel('x');
>> ylabel('y')
>> title('Plot kurva y=x^2-10x+15')
Jawaban Kuis dalpro

4.
a.
>> a=[1 2];
>> b=[1 1];
>> c=conv(a,b)

c=

1 3 2

>> d=[1 3];

>> e=conv(c,d)

e=

1 6 11 6

>> f=[1 4];


>> g=conv(e,f)

g=

1 10 35 50 24

>> num=[1];
>> den=g;
>> [r,p,k]=residue(num,den)

r=

-0.1667
0.5000
-0.5000
0.1667

p=

-4.0000
-3.0000
-2.0000
-1.0000

k=
Jawaban Kuis dalpro

[]

b.
>> a=[1 0 0];
>> b=[1 1];
>> c=conv(a,b);
>> d=[1 2];
>> e=conv(c,d);
>> f=[1 6 9];
>> g=conv(e,f)

g=

1 9 29 39 18 0 0

>> num=[2];
>> den=g

den =

1 9 29 39 18 0 0

>> [r,p,k]=residue(num,den)

r=

0.2407
0.1111
-0.5000
0.5000
-0.2407
0.1111

p=

-3.0000
-3.0000
-2.0000
-1.0000
0
0

k=
Jawaban Kuis dalpro

[]

5.
a.
>> dsolve('D4x+D3x=cos(t)','x(0)=0','Dx(0)=0','D2x(0)=1','D3x(0)=0')

ans =

-1/2*sin(t)+1/2*cos(t)+1/2*exp(-t)+1/2*t^2+t-1

b.
>> dsolve('D2y+3*Dy+y=1','y(0)=0','Dy(0)=0')

ans =

exp(1/2*(5^(1/2)-3)*t)*(-3/10*5^(1/2)-1/2)+exp(-1/2*(5^(1/2)+3)*t)*(3/10*5^(1/2)-
1/2)+1

You might also like