0% found this document useful (0 votes)
12 views9 pages

Tugas 2 Aplikom

This document contains the solutions to assignment 2 on linear algebra. It defines several vectors and matrices, performs operations on them such as calculating sizes and lengths, and generates identity, zero, and one matrices based on the sizes of given matrices.

Uploaded by

Amalia Nida
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views9 pages

Tugas 2 Aplikom

This document contains the solutions to assignment 2 on linear algebra. It defines several vectors and matrices, performs operations on them such as calculating sizes and lengths, and generates identity, zero, and one matrices based on the sizes of given matrices.

Uploaded by

Amalia Nida
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

TUGAS 2 APLIKOM

Nama : Mia Dwi Rosiyanti


NIM :18103021006

No.1

>> vektor1=[10,20,30,40]

vektor1 =

10 20 30 40

>> vektor2=[-5;-15;-40]

vektor2 =

-5

-15

-40

>> matriks1=[1 3 5 0; 3 1 3 5; 5 3 1 3; 0 5 3 1]

matriks1 =

1 3 5 0

3 1 3 5

5 3 1 3

0 5 3 1
No.2

>> A=[4 8; 2

4] A =

4 8

2 4

>> B=[1 1; 1 -

1] B =

1 1

1 -1

>> C=[A

B] C =

4 8 1 1

2 4 1 -1

>> W=[B B; B -B]

W=

1 1 1 1

1 -1 1 -1

1 1 -1 -1

1 -1 -1 1
No.3

>> nomor3a_1=size(vektor1)

nomor3a_1 =

1 4

>> nomor3a_2=size(vektor2)

nomor3a_2 =

3 1

>> nomor3a_3=size(matriks1)

nomor3a_3 =

4 4

>> nomor3a_4=size(A)

nomor3a_4 =

2 2

>> nomor3a_5=size(B)

nomor3a_5 =

2 2

>>

nomor3a_6=size(C)

nomor3a_6 =

2 4
>> nomor3a_7=size(W)

nomor3a_7 =

4 4

>> nomor3b_1=length(vektor1)

nomor3b_1 =

>> nomor3b_2=length(vektor2)

nomor3b_2 =

>> nomor3b_3=length(matriks1)

nomor3b_3 =

>>

nomor3b_4=length(A)

nomor3b_4 =

>>

nomor3b_5=length(B)

nomor3b_5 =

2
>>

nomor3b_6=length(C)

nomor3b_6 =

>>

nomor3b_7=length(W)

nomor3b_7 =

4
No.4

>> matriks_1=[5 0 0 0

0500

0050

0 0 0 5]

matriks_1 =

5 0 0 0

0 5 0 0

0 0 5 0

0 0 0 5

>> matriks_2=[5 5 0 0

5500

-5 0 0 5

0 -5 5 0]

matriks_2 =
5 5 0 0

5 5 0 0

-5 0 0 5

0 -5 5 0

>>

mat_1_1=ones(size(matriks_1))

mat_1_1 =

1 1 1 1

1 1 1 1

1 1 1 1

1 1 1 1

>>

mat_1_2=zeros(size(matriks_1))

mat_1_2 =

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

>>

mat_1_3=eye(size(matriks_1))

mat_1_3 =
1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

>>

mat_2_1=ones(size(matriks_2))

mat_2_1 =

1 1 1 1

1 1 1 1

1 1 1 1

1 1 1 1

>>

mat_2_2=zeros(size(matriks_2))

mat_2_2 =

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

>>

mat_2_3=eye(size(matriks_2))

mat_2_3 =
1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

>>

You might also like