Program exercises 1 (Kelas S1TI-1N)

Soal exercises and problems bagi kelas S1TI-1N klik di sini, kerjakan untuk nomor:

I : 1.a,b; 2.a,b; 3.a,b; 4.a; 5.a; 6.a,b; 9

II : 1.a,b,c; 2.a,b;5

  1. Silahkan menuliskan jawaban program menggunakan program matematika, seperti matlab, mathematics wolfram dan sebagainya di bagian komentar.
  2. Jangan lupa menuliskan nama dan NIM anda.
  3. Ingat perhatikan baik-baik kelas anda, selain program / koding, tuliskan keluaran/hasil eksekusinya dari program yang anda tulis

Perhatian : komentar tidak akan ditampilkan sebelum disetujui.

111 Responses

  1. I.exercises and problems

    1.================================
    a.——————————–
    –>[1,2,-1;0,2,2]-[3,1,0;1,1,1]
    ans =

    – 2. 1. – 1.
    – 1. 1. 1.

    b.——————————–
    –>2*[1;2]-5*[2;2]+3*[4;1]
    ans =

    4.
    – 3.

    2.=================================
    a.———————————
    –>8*[1,2,-1;1,0,0;2,-1,3]
    ans =

    8. 16. – 8.
    8. 0. 0.
    16. – 8. 24.

    b.———————————
    –>[-2;-3]+3*[2;-1]
    ans =

    4.
    – 6.

    or———————————-

    –>-1*[2;3]+3*[2;-1]
    ans =

    4.
    – 6.

    3.=================================
    –>A=[1,0,-1;1,1,2]
    A =

    1. 0. – 1.
    1. 1. 2.

    –>B=[2,2;1,-2]
    B =

    2. 2.
    1. – 2.

    –>

    –>C=[1,1,0;2,1,0]
    C =

    1. 1. 0.
    2. 1. 0.

    a.———————————
    –>A+(3*B)
    !–error 8
    Inconsistent addition.

    b.———————————
    –>(2*A)+(3*C)
    ans =

    5. 3. – 2.
    8. 5. 4.

    4.=================================
    a.
    –>X+(3*A)==C;
    –>X=C-(3*A)
    X =

    – 2. 1. 3.
    – 1. – 2. – 6.

    5.=================================
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a.——————————-
    >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    b——————————–
    >> [x-y;2*x+3*y]
    ans =
    [x-y]
    [2*x+3*y]

    6.================================
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    9.=================================

    –>a= [1,0;0,0]
    a =

    1. 0.
    0. 0.

    –>b=[0,1;0,0]
    b =

    0. 1.
    0. 0.

    –>c=[0,0;1,0]
    c =

    0. 0.
    1. 0.

    –>d=[0,0;0,1]
    d =

    0. 0.
    0. 1.

    –>e=[a,b;c,d]
    e =

    1. 0. 0. 1.
    0. 0. 0. 0.
    0. 0. 0. 0.
    1. 0. 0. 1.
    ======================================
    II. Exercises and Problems
    ======================================
    1==============================
    >> a=[2;1]
    a =
    2.
    1.

    >> b=[3 4]
    b =
    3. 4.

    >> c=[2 1+i;0 -1]
    c =

    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a.———————————
    >> b*c*a
    ans =
    11.0000 + 3.0000i

    b.——————————–
    >> a*b
    ans =
    6 8
    3 4

    c.——————————-
    >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    2.==============================
    a.——————————

    –>a= [1,0;0,1]
    a =

    1. 0.
    0. 1.

    –>b= [3,-2,0;-2,5,8]
    b =

    3. – 2. 0.
    – 2. 5. 8.

    –>a*b
    ans =

    3. – 2. 0.
    – 2. 5. 8.

    b.——————————-

    –>a= [2,1,0;0,8,2]
    a =

    2. 1. 0.
    0. 8. 2.

    –>b=
    !–error 2
    Invalid factor.

    –>[1,1;2,2]
    ans =

    1. 1.
    2. 2.

    –>b= [1,1;2,2]
    b =

    1. 1.
    2. 2.

    –>a*b
    !–error 10
    Inconsistent multiplication

    5=======================================

    >> A=[2,-1,1;2,3,-2;4,2,-2]
    A =
    2. -1. 1.
    2. 3. -2.
    4. 2. -2.

    >> b=[2;-3;1]
    b =
    2.
    -3.
    1.

    >> a=[x;y;z]
    a =
    [x]
    [y]
    [z]

    >> X=[x,0,0;0,y,0;0,0,z]
    X =
    [x. 0. 0.]
    [0. y. 0.]
    [0. 0. z.]

    >> X*A*b+A*a
    ans =

    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  2. I. Exercises and Problems
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =

    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    Part II
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.
    Reply

  3. Nama : Muh Rais Ulil Albab
    Nim : 10.11.4586
    Kelas : S1 TI N

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6

    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)

    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000

    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =
    6 8
    3 4

    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2

    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  4. I. Exercises and Problems

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2
    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2
    >> 3*B
    ans =

    6 6

    3 -6b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Part II

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]
    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2

    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5

    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

    Relly Puspita
    10.11.4587

  5. ARFAN KURNIAWAN
    10.11.4592
    S1-TI-1N

    I. Exercises and Problems

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2
    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2
    >> 3*B
    ans =

    6 6

    3 -6b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Part II

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]
    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2

    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5

    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  6. Nama : Angga Virgian J
    Nim : 10.11.4550

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.
    Reply

  7. Nama : Syafrullah Anggie Fauzie
    Nim : 10.11.4565

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  8. Nama : Joko Prasetyo
    Nim : 10.11.4597

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  9. Nama : Dyas Yudi Priyanggodo
    NIM : 10.11.4549

    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1
    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8
    8 0 0
    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6

    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2
    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0
    a. >> A+3*B

    >> A
    A =

    1 0 -1

    1 1 2
    >> 3*B
    ans =

    6 6

    3 -6b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Part II
    Exercises 1
    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]
    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]

  10. Nama : Veri Hendra Hikmawan
    NIM : 10.11.4582

    I.Exercises and Problem

    Exercises 1
    (a). >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    (b). >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1

    Exercises 2
    (a). >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    (b). >> -[2 3] + 3*[2 -1]
    ans =
    4 -6

    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    (a). >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    (b). >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4

    exercises 4
    (a). >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6

    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    (a). >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    (a). >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    (b). >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    (a). >> b*c*a
    ans =
    11.0000 + 3.0000i
    (b). >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    (a). >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    (b). >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  11. Nama : Fendy Sapto Purwoko
    NIM : 10.11.4580

    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2
    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2
    >> 3*B
    ans =

    6 6

    3 -6b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Part II
    Exercises 1
    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]
    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  12. Nama : Fendy Sapto Purwoko
    NIM : 10.11.4580

    Exercises and Problems
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2
    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2
    >> 3*B
    ans =

    6 6

    3 -6b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Part II
    Exercises 1
    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]
    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  13. Nama : Doharma Hutagalung
    NIM : 10.11.4560

    I. Exercises and Problems

    Exercise 1

    A. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1
    -1 1 1

    B. >> 2*[1 ; 3] – 5*[2 ; 2] + 3*[4 ; 1]

    ans =

    4
    -1

    Exercise 2

    A. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]

    ans =

    8 16 -8
    8 0 0
    16 -8 24

    B. >> -[2 ; 3] + 3*[2 ; -1]

    ans =

    4
    -6

    Exercise 3

    >> A=[1 0 -1 ; 1 1 2], B=[2 2 ; 1 -2], C=[1 1 0 ; 2 1 0]

    A =

    1 0 -1
    1 1 2

    B =

    2 2
    1 -2

    C =

    1 1 0
    2 1 0

    A. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.

    B. >> 2*A-3*C

    ans =

    -1 -3 -2
    -4 -1 4

    Exercise 4

    A. >> X=C-3*A

    X =

    -2 1 3
    -1 -2 -6

    Exercise 5

    A. >> syms (‘x’), syms(‘y’), syms(‘z’)
    >> [x+2*y ; 2*x-z]

    ans =

    [ x+2*y]
    [ 2*x-z ]

    Exercise 6

    A. >> syms (‘x’), syms(‘y’), syms(‘z’)
    >> [3*x+y ; x+y+z]

    ans =

    [ 3*x+y ]
    [ x+y+z ]

    Exercise 9

    ###### SAYA MASIH BINGUNG PAK ##########

    II. Exercises and Problems

    Exercise 1

    >> a=[2 ; 1], b=[3 4], C=[2 1+i ; 0 -i]

    a =

    2
    1

    b =

    3 4

    C =

    2.0000 1.0000 + 1.0000i
    0 0 – 1.0000i

    A. >> b*C*a

    ans =

    15.0000 – 1.0000i

    B. >> a*b

    ans =

    6 8
    3 4

    C. >> C*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2

    A. >> [1 0 ; 0 1] * [3 -2 0 ; -2 5 8]

    ans =

    3 -2 0
    -2 5 8

    B. >> [2 1 0 ; 0 8 2] * [1 1 ; 2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5

    ###### SAYA MASIH BINGUNG PAK ##########

    I. Exercises and Problems

    Exercise 1

    A. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1
    -1 1 1

    B. >> 2*[1 ; 3] – 5*[2 ; 2] + 3*[4 ; 1]

    ans =

    4
    -1

    Exercise 2

    A. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]

    ans =

    8 16 -8
    8 0 0
    16 -8 24

    B. >> -[2 ; 3] + 3*[2 ; -1]

    ans =

    4
    -6

    Exercise 3

    >> A=[1 0 -1 ; 1 1 2], B=[2 2 ; 1 -2], C=[1 1 0 ; 2 1 0]

    A =

    1 0 -1
    1 1 2

    B =

    2 2
    1 -2

    C =

    1 1 0
    2 1 0

    A. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.

    B. >> 2*A-3*C

    ans =

    -1 -3 -2
    -4 -1 4

    Exercise 4

    A. >> X=C-3*A

    X =

    -2 1 3
    -1 -2 -6

    Exercise 5

    A. >> syms (‘x’), syms(‘y’), syms(‘z’)
    >> [x+2*y ; 2*x-z]

    ans =

    [ x+2*y]
    [ 2*x-z ]

    Exercise 6

    A. >> syms (‘x’), syms(‘y’), syms(‘z’)
    >> [3*x+y ; x+y+z]

    ans =

    [ 3*x+y ]
    [ x+y+z ]

    Exercise 9

    ###### SAYA MASIH BINGUNG PAK ##########

    II. Exercises and Problems

    Exercise 1

    >> a=[2 ; 1], b=[3 4], C=[2 1+i ; 0 -i]

    a =

    2
    1

    b =

    3 4

    C =

    2.0000 1.0000 + 1.0000i
    0 0 – 1.0000i

    A. >> b*C*a

    ans =

    15.0000 – 1.0000i

    B. >> a*b

    ans =

    6 8
    3 4

    C. >> C*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2

    A. >> [1 0 ; 0 1] * [3 -2 0 ; -2 5 8]

    ans =

    3 -2 0
    -2 5 8

    B. >> [2 1 0 ; 0 8 2] * [1 1 ; 2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5

    ###### SAYA MASIH BINGUNG PAK ##########

  14. Nama : Fendy Sapto Purwoko
    NIM : 10.11.4580

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  15. No.1.
    >> a=[1 2 3;4 5 6]
    a =
    1 2 3
    4 5 6
    …>> b=[7 8 9;0 1 2]
    b =
    7 8 9
    0 1 2
    >> a+b
    ans =
    8 10 12
    4 6 8
    >> a-b
    ans =
    -6 -6 -6
    4 4 4
    No,2.
    >> a= [1 0 -1]
    a =
    1 0 -1
    >> b= [4;3;2]
    b =
    4
    3
    2
    >> a*b
    ans =
    2
    .3.
    >>A=[1 0;1 1]
    A =
    1 0
    1 1
    >> B=[2 3;4 1]
    B =
    2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C =
    1 1 2
    0 2 3
    >> A*B
    ans =
    2 3
    6 4
    >> B*A
    ans =
    5 3
    5 1
    >> A*C
    ans =
    1 1 2
    1 3 5
    >> B*C
    ans =
    2 8 13 4 6 11
    No.4.
    >> [3 0;0 2]*[1 2 3;4 5 6]
    ans =
    3 6 9
    8 10 12
    >> [1 2 3;4 5 6]*[2 0 0;0 3 0;0 0 1]
    ans =
    2 6 3
    8 15 6

  16. Aditya Nugraha
    10.11.4583

    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =
    ……

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2
    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2
    >> 3*B
    ans =

    6 6

    3 -6b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Part II
    Exercises 1
    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]
    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  17. I. Exercises and Problem

    Exercises 1

    a.
    >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a.
    >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Exercises 9
    error

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  18. I. Exercises and Problem

    Exercises 1

    a.
    >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a.
    >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Exercises 9
    error

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  19. LALU ISPANDI AKBAR
    10.11.4576

    EXERCISES AND PROBLEM 1

    I
    no.1
    (a)
    >> A = [1 2 -1; 0 2 2]

    A =

    1 2 -1
    0 2 2

    >> B = [3 1 0; 1 1 1 ]

    B =

    3 1 0
    1 1 1

    >> A – B

    ans =

    -2 1 -1
    -1 1 1

    (b)
    >> A=[1; 3]

    A =

    1
    3

    >> B=[2; 2]

    B =

    2
    2

    >> C=[4; 1]

    C =

    4
    1

    >> D=2*A

    D =

    2
    6

    >> E=5*B

    E =

    10
    10

    >> F=3*C

    F =

    12
    3

    >> D-E+F

    ans =

    4
    -1

    no.2
    (a)
    >> A=[1 2 -1; 1 0 0; 2 -1 3]

    A =

    1 2 -1
    1 0 0
    2 -1 3

    >> 8*A

    ans =

    8 16 -8
    8 0 0
    16 -8 24

    (b)
    >> A=[2;3]

    A =

    2
    3

    >> B=[2; -1]

    B =

    2
    -1

    >> C=-1*A

    C =

    -2
    -3

    >> D=3*B

    D =

    6
    -3

    >> C+D

    ans =

    4
    -6

    no.3

    >> A=[1 0 -1; 1 1 2]

    A =

    1 0 -1
    1 1 2

    >> B=[2 2; 1 -2]

    B =

    2 2
    1 -2

    >> C=[1 1 0; 2 1 0]

    C =

    1 1 0
    2 1 0

    (a)
    >> 3*B

    ans =

    6 6
    3 -6

    >> A+(3*B)
    ??? Error using ==> +
    Matrix dimensions must agree.

    (b)
    >> 2*A

    ans =

    2 0 -2
    2 2 4

    >> 3*C

    ans =

    3 3 0
    6 3 0

    >> (2*A)-(3*C)

    ans =

    -1 -3 -2
    -4 -1 4

    No.4
    (a)
    >> A=[1 0 -1; 1 1 2]

    A =

    1 0 -1
    1 1 2

    >> B=[2 2; 1 -2]

    B =

    2 2
    1 -2

    >> C=[1 1 0; 2 1 0]

    C =

    1 1 0
    2 1 0

    X +3A=C

    >> 3*A

    ans =

    3 0 -3
    3 3 6

    >> X=C-(3*A)

    X =

    -2 1 3
    -1 -2 -6

    no.5
    (a)
    >> a = inline(‘[x + 2*y; 2*x – z]’)

    a =

    Inline function:
    a(x,y,z) = [x + 2*y; 2*x – z]

    >> a(1,2,3)

    ans =

    5
    -1

    no.6
    (a)
    >> a = inline(‘[3*x + y; x + y + z]’)

    a =

    Inline function:
    a(x,y,z) = [3*x + y; x + y + z]

    >> a(1,2,3)

    ans =

    5
    6

    (b)
    >> a = inline(‘[3*x + y; x + y + z]’)

    a =

    Inline function:
    a(x,y,z) = [3*x + y; x + y + z]

    >> a(1,2,3)

    ans =

    5
    6

    no.9
    >> a = [1 0; 0 0]

    a =

    1 0
    0 0

    >> b = [0 1; 0 0]

    b =

    0 1
    0 0

    >> c = [0 0; 1 0]

    c =

    0 0
    1 0

    >> d = [0 0; 0 1]

    d =

    0 0
    0 1

    >> gabung1=[a b; c d]

    gabung1 =

    1 0 0 1
    0 0 0 0
    0 0 0 0
    1 0 0 1

    II
    no.1

    >> a=[2; 1]

    a =

    2
    1

    >> b=[3, 4]

    b =

    3 4

    >> C=[2 1 + i; 0 -1]

    C =

    2.0000 1.0000 + 1.0000i
    0 -1.0000
    (a)
    >> b*C*a

    ans =

    11.0000 + 3.0000i
    (b)
    >> a*b

    ans =

    6 8
    3 4
    (c)
    >> C*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    no.2
    (a)
    >> a=[1 0; 0 1]

    a =

    1 0
    0 1

    >> A=[1 0; 0 1]

    A =

    1 0
    0 1

    >> B=[3 -2 0; -2 5 8]

    B =

    3 -2 0
    -2 5 8

    >> A*B

    ans =

    3 -2 0
    -2 5 8
    (b)
    >> A=[2 1 0; 0 8 2]

    A =

    2 1 0
    0 8 2

    >> B=[1 1; 2 2]

    B =

    1 1
    2 2

    >> A*B
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    no.5

    >> A = [2 -1 1; 2 3 -2; 4 2 -2]

    A =

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

    >> b = [2; -3; 1]

    b =

    2
    -3
    1

    >> x = [‘x’;’y’; ‘z’]

    x =

    x
    y
    z

    >> X = [‘x’ ‘0’ ‘0’; ‘0’ ‘y’ ‘0’; ‘0’ ‘0’ ‘z’]

    X =

    x00
    0y0
    00z

    >> j = [3; 1; 2]

    j =

    3
    1
    2

    >> %XAb + Ax = j
    >> %A(Xb + x) = j
    2 -1 1 x 0 0 2 x 3
    2 3 -2 *( 0 y 0 * -3 + y ) = 1
    4 2 -2 0 0 z 1 z 2
    >> %Xb + x = v

    x 0 0 2 x 3x
    ( 0 y 0 * – 3 + y ) = -2y
    0 0 z 1 z 2z
    >> %A*v = j

    2 -1 1 3x 3
    2 3 -2 * -2y = 1
    4 2 -2 2z 2
    >> %A*v = g
    2 -1 1 3x 6x + 2y + 2z
    2 3 -2 * -2y = 6x – 6y – 4z
    4 2 -2 2z 12x – 4y – 4z

    >> %memisahkan kostanta xyz

    6 2 2 x 3
    6 -6 -4 * y = 2
    12 -4 -4 z 1

    >> G = [6 2 2; 6 -6 -4; 12 -4 -4]

    G =

    6 2 2
    6 -6 -4
    12 -4 -4

    >> %xyz = j\G
    >> xyz = inv(G)*j

    xyz =

    0.3333
    -0.5000
    1.0000

  20. I. Exercises and Problem

    Exercises 1

    a.
    >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a.
    >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Exercises 9
    error

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  21. Nama: Agus Sri Widodo (10.11.4604/1N)
    I. Exercises and Problem
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  22. Nama:Agus Sri Widodo (10.11.4604)
    Kelas 1N
    I. Exercises and Problem
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  23. I. Exercises and Problem
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  24. I. Exercises and Problem

    Exercises 1

    a.
    >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a.
    >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Exercises 9
    error

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  25. Angga Virgian (.10.11.4550)

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Exercises 9
    error

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  26. ADHI BOWO
    10.11.4609

    EXERCISES AND PROBLEM 1

    I
    no.1
    (a)
    >> A = [1 2 -1; 0 2 2]

    A =

    1 2 -1
    0 2 2

    >> B = [3 1 0; 1 1 1 ]

    B =

    3 1 0
    1 1 1

    >> A – B

    ans =

    -2 1 -1
    -1 1 1

    (b)
    >> A=[1; 3]

    A =

    1
    3

    >> B=[2; 2]

    B =

    2
    2

    >> C=[4; 1]

    C =

    4
    1

    >> D=2*A

    D =

    2
    6

    >> E=5*B

    E =

    10
    10

    >> F=3*C

    F =

    12
    3

    >> D-E+F

    ans =

    4
    -1

    no.2
    (a)
    >> A=[1 2 -1; 1 0 0; 2 -1 3]

    A =

    1 2 -1
    1 0 0
    2 -1 3

    >> 8*A

    ans =

    8 16 -8
    8 0 0
    16 -8 24

    (b)
    >> A=[2;3]

    A =

    2
    3

    >> B=[2; -1]

    B =

    2
    -1

    >> C=-1*A

    C =

    -2
    -3

    >> D=3*B

    D =

    6
    -3

    >> C+D

    ans =

    4
    -6

    no.3

    >> A=[1 0 -1; 1 1 2]

    A =

    1 0 -1
    1 1 2

    >> B=[2 2; 1 -2]

    B =

    2 2
    1 -2

    >> C=[1 1 0; 2 1 0]

    C =

    1 1 0
    2 1 0

    (a)
    >> 3*B

    ans =

    6 6
    3 -6

    >> A+(3*B)
    ??? Error using ==> +
    Matrix dimensions must agree.

    (b)
    >> 2*A

    ans =

    2 0 -2
    2 2 4

    >> 3*C

    ans =

    3 3 0
    6 3 0

    >> (2*A)-(3*C)

    ans =

    -1 -3 -2
    -4 -1 4

    No.4
    (a)
    >> A=[1 0 -1; 1 1 2]

    A =

    1 0 -1
    1 1 2

    >> B=[2 2; 1 -2]

    B =

    2 2
    1 -2

    >> C=[1 1 0; 2 1 0]

    C =

    1 1 0
    2 1 0

    X +3A=C

    >> 3*A

    ans =

    3 0 -3
    3 3 6

    >> X=C-(3*A)

    X =

    -2 1 3
    -1 -2 -6

    no.5
    (a)
    >> a = inline(‘[x + 2*y; 2*x – z]’)

    a =

    Inline function:
    a(x,y,z) = [x + 2*y; 2*x – z]

    >> a(1,2,3)

    ans =

    5
    -1

    no.6
    (a)
    >> a = inline(‘[3*x + y; x + y + z]’)

    a =

    Inline function:
    a(x,y,z) = [3*x + y; x + y + z]

    >> a(1,2,3)

    ans =

    5
    6

    (b)
    >> a = inline(‘[3*x + y; x + y + z]’)

    a =

    Inline function:
    a(x,y,z) = [3*x + y; x + y + z]

    >> a(1,2,3)

    ans =

    5
    6

    no.9
    >> a = [1 0; 0 0]

    a =

    1 0
    0 0

    >> b = [0 1; 0 0]

    b =

    0 1
    0 0

    >> c = [0 0; 1 0]

    c =

    0 0
    1 0

    >> d = [0 0; 0 1]

    d =

    0 0
    0 1

    >> gabung1=[a b; c d]

    gabung1 =

    1 0 0 1
    0 0 0 0
    0 0 0 0
    1 0 0 1

    II
    no.1

    >> a=[2; 1]

    a =

    2
    1

    >> b=[3, 4]

    b =

    3 4

    >> C=[2 1 + i; 0 -1]

    C =

    2.0000 1.0000 + 1.0000i
    0 -1.0000
    (a)
    >> b*C*a

    ans =

    11.0000 + 3.0000i
    (b)
    >> a*b

    ans =

    6 8
    3 4
    (c)
    >> C*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    no.2
    (a)
    >> a=[1 0; 0 1]

    a =

    1 0
    0 1

    >> A=[1 0; 0 1]

    A =

    1 0
    0 1

    >> B=[3 -2 0; -2 5 8]

    B =

    3 -2 0
    -2 5 8

    >> A*B

    ans =

    3 -2 0
    -2 5 8
    (b)
    >> A=[2 1 0; 0 8 2]

    A =

    2 1 0
    0 8 2

    >> B=[1 1; 2 2]

    B =

    1 1
    2 2

    >> A*B
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    no.5

    >> A = [2 -1 1; 2 3 -2; 4 2 -2]

    A =

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

    >> b = [2; -3; 1]

    b =

    2
    -3
    1

    >> x = [‘x’;’y’; ‘z’]

    x =

    x
    y
    z

    >> X = [‘x’ ‘0’ ‘0’; ‘0’ ‘y’ ‘0’; ‘0’ ‘0’ ‘z’]

    X =

    x00
    0y0
    00z

    >> j = [3; 1; 2]

    j =

    3
    1
    2

    >> %XAb + Ax = j
    >> %A(Xb + x) = j
    2 -1 1 x 0 0 2 x 3
    2 3 -2 *( 0 y 0 * -3 + y ) = 1
    4 2 -2 0 0 z 1 z 2
    >> %Xb + x = v

    x 0 0 2 x 3x
    ( 0 y 0 * – 3 + y ) = -2y
    0 0 z 1 z 2z
    >> %A*v = j

    2 -1 1 3x 3
    2 3 -2 * -2y = 1
    4 2 -2 2z 2
    >> %A*v = g
    2 -1 1 3x 6x + 2y + 2z
    2 3 -2 * -2y = 6x – 6y – 4z
    4 2 -2 2z 12x – 4y – 4z

    >> %memisahkan kostanta xyz

    6 2 2 x 3
    6 -6 -4 * y = 2
    12 -4 -4 z 1

    >> G = [6 2 2; 6 -6 -4; 12 -4 -4]

    G =

    6 2 2
    6 -6 -4
    12 -4 -4

    >> %xyz = j\G
    >> xyz = inv(G)*j

    xyz =

    0.3333
    -0.5000
    1.0000

  27. danny (10.11.4578)

    I. Exercises and Problem
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  28. FATAN
    10.11.4568

    EXERCISES AND PROBLEM 1

    I
    no.1
    (a)
    >> A = [1 2 -1; 0 2 2]

    A =

    1 2 -1
    0 2 2

    >> B = [3 1 0; 1 1 1 ]

    B =

    3 1 0
    1 1 1

    >> A – B

    ans =

    -2 1 -1
    -1 1 1

    (b)
    >> A=[1; 3]

    A =

    1
    3

    >> B=[2; 2]

    B =

    2
    2

    >> C=[4; 1]

    C =

    4
    1

    >> D=2*A

    D =

    2
    6

    >> E=5*B

    E =

    10
    10

    >> F=3*C

    F =

    12
    3

    >> D-E+F

    ans =

    4
    -1

    no.2
    (a)
    >> A=[1 2 -1; 1 0 0; 2 -1 3]

    A =

    1 2 -1
    1 0 0
    2 -1 3

    >> 8*A

    ans =

    8 16 -8
    8 0 0
    16 -8 24

    (b)
    >> A=[2;3]

    A =

    2
    3

    >> B=[2; -1]

    B =

    2
    -1

    >> C=-1*A

    C =

    -2
    -3

    >> D=3*B

    D =

    6
    -3

    >> C+D

    ans =

    4
    -6

    no.3

    >> A=[1 0 -1; 1 1 2]

    A =

    1 0 -1
    1 1 2

    >> B=[2 2; 1 -2]

    B =

    2 2
    1 -2

    >> C=[1 1 0; 2 1 0]

    C =

    1 1 0
    2 1 0

    (a)
    >> 3*B

    ans =

    6 6
    3 -6

    >> A+(3*B)
    ??? Error using ==> +
    Matrix dimensions must agree.

    (b)
    >> 2*A

    ans =

    2 0 -2
    2 2 4

    >> 3*C

    ans =

    3 3 0
    6 3 0

    >> (2*A)-(3*C)

    ans =

    -1 -3 -2
    -4 -1 4

    No.4
    (a)
    >> A=[1 0 -1; 1 1 2]

    A =

    1 0 -1
    1 1 2

    >> B=[2 2; 1 -2]

    B =

    2 2
    1 -2

    >> C=[1 1 0; 2 1 0]

    C =

    1 1 0
    2 1 0

    X +3A=C

    >> 3*A

    ans =

    3 0 -3
    3 3 6

    >> X=C-(3*A)

    X =

    -2 1 3
    -1 -2 -6

    no.5
    (a)
    >> a = inline(‘[x + 2*y; 2*x – z]’)

    a =

    Inline function:
    a(x,y,z) = [x + 2*y; 2*x – z]

    >> a(1,2,3)

    ans =

    5
    -1

    no.6
    (a)
    >> a = inline(‘[3*x + y; x + y + z]’)

    a =

    Inline function:
    a(x,y,z) = [3*x + y; x + y + z]

    >> a(1,2,3)

    ans =

    5
    6

    (b)
    >> a = inline(‘[3*x + y; x + y + z]’)

    a =

    Inline function:
    a(x,y,z) = [3*x + y; x + y + z]

    >> a(1,2,3)

    ans =

    5
    6

    no.9
    >> a = [1 0; 0 0]

    a =

    1 0
    0 0

    >> b = [0 1; 0 0]

    b =

    0 1
    0 0

    >> c = [0 0; 1 0]

    c =

    0 0
    1 0

    >> d = [0 0; 0 1]

    d =

    0 0
    0 1

    >> gabung1=[a b; c d]

    gabung1 =

    1 0 0 1
    0 0 0 0
    0 0 0 0
    1 0 0 1

    II
    no.1

    >> a=[2; 1]

    a =

    2
    1

    >> b=[3, 4]

    b =

    3 4

    >> C=[2 1 + i; 0 -1]

    C =

    2.0000 1.0000 + 1.0000i
    0 -1.0000
    (a)
    >> b*C*a

    ans =

    11.0000 + 3.0000i
    (b)
    >> a*b

    ans =

    6 8
    3 4
    (c)
    >> C*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    no.2
    (a)
    >> a=[1 0; 0 1]

    a =

    1 0
    0 1

    >> A=[1 0; 0 1]

    A =

    1 0
    0 1

    >> B=[3 -2 0; -2 5 8]

    B =

    3 -2 0
    -2 5 8

    >> A*B

    ans =

    3 -2 0
    -2 5 8
    (b)
    >> A=[2 1 0; 0 8 2]

    A =

    2 1 0
    0 8 2

    >> B=[1 1; 2 2]

    B =

    1 1
    2 2

    >> A*B
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    no.5

    >> A = [2 -1 1; 2 3 -2; 4 2 -2]

    A =

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

    >> b = [2; -3; 1]

    b =

    2
    -3
    1

    >> x = [‘x’;’y’; ‘z’]

    x =

    x
    y
    z

    >> X = [‘x’ ‘0’ ‘0’; ‘0’ ‘y’ ‘0’; ‘0’ ‘0’ ‘z’]

    X =

    x00
    0y0
    00z

    >> j = [3; 1; 2]

    j =

    3
    1
    2

    >> %XAb + Ax = j
    >> %A(Xb + x) = j
    2 -1 1 x 0 0 2 x 3
    2 3 -2 *( 0 y 0 * -3 + y ) = 1
    4 2 -2 0 0 z 1 z 2
    >> %Xb + x = v

    x 0 0 2 x 3x
    ( 0 y 0 * – 3 + y ) = -2y
    0 0 z 1 z 2z
    >> %A*v = j

    2 -1 1 3x 3
    2 3 -2 * -2y = 1
    4 2 -2 2z 2
    >> %A*v = g
    2 -1 1 3x 6x + 2y + 2z
    2 3 -2 * -2y = 6x – 6y – 4z
    4 2 -2 2z 12x – 4y – 4z

    >> %memisahkan kostanta xyz

    6 2 2 x 3
    6 -6 -4 * y = 2
    12 -4 -4 z 1

    >> G = [6 2 2; 6 -6 -4; 12 -4 -4]

    G =

    6 2 2
    6 -6 -4
    12 -4 -4

    >> %xyz = j\G
    >> xyz = inv(G)*j

    xyz =

    0.3333
    -0.5000
    1.0000

  29. I. Exercises and Problem
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  30. I. Exercises and Problem
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  31. erwan (10.11.4564)

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Exercises 9
    error

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  32. Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  33. Waahid S.N.R
    (10.11.4575)

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  34. Waahid S.N.R
    (10.11.4575)

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  35. 1) >> A=[1 2 3;4 5 6]
    A =
    1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B =
    7 8 9
    0 1 2
    >> A+B
    ans =
    8 10 12
    4 6 8
    >> A-B
    ans =
    -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a =
    1 0 -1
    >> b=[4 ; 3; 2]
    b =
    4
    3
    2
    >> a*b
    ans =
    2

    3) >> A=[1 0;1 1]

    A =
    1 0
    1 1
    >> B=[2 3;4 1]
    B =
    2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C =
    1 1 2
    0 2 3
    >> A*B
    ans =
    2 3
    6 4
    >> B*A
    ans =
    5 3
    5 1
    >> A*C (DEFINED)
    ans =
    1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A =
    3 0
    0 2

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

    >> A*B
    ans =
    3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C =
    1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D =
    2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans =
    2 6 3
    8 15 6

  36. joko tri purwanto
    10.11.4561

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Exercises 9
    error

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  37. Agung okta
    I. Exercises and Problems
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2
    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2
    >> 3*B
    ans =

    6 6

    3 -6b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Part II
    Exercises 1
    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]
    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result. ·

  38. Agung okta Fiyanto
    I. Exercises and Problems
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2
    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2
    >> 3*B
    ans =

    6 6

    3 -6b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Part II
    Exercises 1
    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]
    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  39. Agung Oktafiyanto
    I. Exercises and Problems
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2
    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2
    >> 3*B
    ans =

    6 6

    3 -6b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Part II
    Exercises 1
    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]
    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  40. I.exercises and problems

    NAMA : NINDA KHANA AINURROKHISA
    NIM : 10.11.4577

    1.===================
    a.——————————–
    –>[1,2,-1;0,2,2]-[3,1,0;1,1,1]
    ans =

    – 2. 1. – 1.
    – 1. 1. 1.

    b.——————————–
    –>2*[1;2]-5*[2;2]+3*[4;1]
    ans =

    4.
    – 3.

    2.====================
    a.———————————
    –>8*[1,2,-1;1,0,0;2,-1,3]
    ans =

    8. 16. – 8.
    8. 0. 0.
    16. – 8. 24.

    b.———————————
    –>[-2;-3]+3*[2;-1]
    ans =

    4.
    – 6.

    or———————————-

    –>-1*[2;3]+3*[2;-1]
    ans =

    4.
    – 6.

    3.=====================
    –>A=[1,0,-1;1,1,2]
    A =

    1. 0. – 1.
    1. 1. 2.

    –>B=[2,2;1,-2]
    B =

    2. 2.
    1. – 2.

    –>

    –>C=[1,1,0;2,1,0]
    C =

    1. 1. 0.
    2. 1. 0.

    a.———————————
    –>A+(3*B)
    !–error 8
    Inconsistent addition.

    b.———————————
    –>(2*A)+(3*C)
    ans =

    5. 3. – 2.
    8. 5. 4.

    4.===================
    a.
    –>X+(3*A)==C;
    –>X=C-(3*A)
    X =

    – 2. 1. 3.
    – 1. – 2. – 6.

    5.==================
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a.——————————-
    >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    b——————————–
    >> [x-y;2*x+3*y]
    ans =
    [x-y]
    [2*x+3*y]

    6.===================
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    9.===================

    –>a= [1,0;0,0]
    a =

    1. 0.
    0. 0.

    –>b=[0,1;0,0]
    b =

    0. 1.
    0. 0.

    –>c=[0,0;1,0]
    c =

    0. 0.
    1. 0.

    –>d=[0,0;0,1]
    d =

    0. 0.
    0. 1.

    –>e=[a,b;c,d]
    e =

    1. 0. 0. 1.
    0. 0. 0. 0.
    0. 0. 0. 0.
    1. 0. 0. 1.
    =======================
    II. Exercises and Problems
    =======================
    1======================
    >> a=[2;1]
    a =
    2.
    1.

    >> b=[3 4]
    b =
    3. 4.

    >> c=[2 1+i;0 -1]
    c =

    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a.———————————
    >> b*c*a
    ans =
    11.0000 + 3.0000i

    b.——————————–
    >> a*b
    ans =
    6 8
    3 4

    c.——————————-
    >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    2.======================
    a.——————————

    –>a= [1,0;0,1]
    a =

    1. 0.
    0. 1.

    –>b= [3,-2,0;-2,5,8]
    b =

    3. – 2. 0.
    – 2. 5. 8.

    –>a*b
    ans =

    3. – 2. 0.
    – 2. 5. 8.

    b.——————————-

    –>a= [2,1,0;0,8,2]
    a =

    2. 1. 0.
    0. 8. 2.

    –>b=
    !–error 2
    Invalid factor.

    –>[1,1;2,2]
    ans =

    1. 1.
    2. 2.

    –>b= [1,1;2,2]
    b =

    1. 1.
    2. 2.

    –>a*b
    !–error 10
    Inconsistent multiplication

    5=======================

    >> A=[2,-1,1;2,3,-2;4,2,-2]
    A =
    2. -1. 1.
    2. 3. -2.
    4. 2. -2.

    >> b=[2;-3;1]
    b =
    2.
    -3.
    1.

    >> a=[x;y;z]
    a =
    [x]
    [y]
    [z]

    >> X=[x,0,0;0,y,0;0,0,z]
    X =
    [x. 0. 0.]
    [0. y. 0.]
    [0. 0. z.]

    >> X*A*b+A*a
    ans =

    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  41. I.exercises and problems

    1.===================
    a.——————————–
    –>[1,2,-1;0,2,2]-[3,1,0;1,1,1]
    ans =

    – 2. 1. – 1.
    – 1. 1. 1.

    b.——————————–
    –>2*[1;2]-5*[2;2]+3*[4;1]
    ans =

    4.
    – 3.

    2.====================
    a.———————————
    –>8*[1,2,-1;1,0,0;2,-1,3]
    ans =

    8. 16. – 8.
    8. 0. 0.
    16. – 8. 24.

    b.———————————
    –>[-2;-3]+3*[2;-1]
    ans =

    4.
    – 6.

    or———————————-

    –>-1*[2;3]+3*[2;-1]
    ans =

    4.
    – 6.

    3.=====================
    –>A=[1,0,-1;1,1,2]
    A =

    1. 0. – 1.
    1. 1. 2.

    –>B=[2,2;1,-2]
    B =

    2. 2.
    1. – 2.

    –>

    –>C=[1,1,0;2,1,0]
    C =

    1. 1. 0.
    2. 1. 0.

    a.———————————
    –>A+(3*B)
    !–error 8
    Inconsistent addition.

    b.———————————
    –>(2*A)+(3*C)
    ans =

    5. 3. – 2.
    8. 5. 4.

    4.===================
    a.
    –>X+(3*A)==C;
    –>X=C-(3*A)
    X =

    – 2. 1. 3.
    – 1. – 2. – 6.

    5.==================
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a.——————————-
    >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    b——————————–
    >> [x-y;2*x+3*y]
    ans =
    [x-y]
    [2*x+3*y]

    6.===================
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    9.===================

    –>a= [1,0;0,0]
    a =

    1. 0.
    0. 0.

    –>b=[0,1;0,0]
    b =

    0. 1.
    0. 0.

    –>c=[0,0;1,0]
    c =

    0. 0.
    1. 0.

    –>d=[0,0;0,1]
    d =

    0. 0.
    0. 1.

    –>e=[a,b;c,d]
    e =

    1. 0. 0. 1.
    0. 0. 0. 0.
    0. 0. 0. 0.
    1. 0. 0. 1.
    =======================
    II. Exercises and Problems
    =======================
    1======================
    >> a=[2;1]
    a =
    2.
    1.

    >> b=[3 4]
    b =
    3. 4.

    >> c=[2 1+i;0 -1]
    c =

    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a.———————————
    >> b*c*a
    ans =
    11.0000 + 3.0000i

    b.——————————–
    >> a*b
    ans =
    6 8
    3 4

    c.——————————-
    >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    2.======================
    a.——————————

    –>a= [1,0;0,1]
    a =

    1. 0.
    0. 1.

    –>b= [3,-2,0;-2,5,8]
    b =

    3. – 2. 0.
    – 2. 5. 8.

    –>a*b
    ans =

    3. – 2. 0.
    – 2. 5. 8.

    b.——————————-

    –>a= [2,1,0;0,8,2]
    a =

    2. 1. 0.
    0. 8. 2.

    –>b=
    !–error 2
    Invalid factor.

    –>[1,1;2,2]
    ans =

    1. 1.
    2. 2.

    –>b= [1,1;2,2]
    b =

    1. 1.
    2. 2.

    –>a*b
    !–error 10
    Inconsistent multiplication

    5=======================

    >> A=[2,-1,1;2,3,-2;4,2,-2]
    A =
    2. -1. 1.
    2. 3. -2.
    4. 2. -2.

    >> b=[2;-3;1]
    b =
    2.
    -3.
    1.

    >> a=[x;y;z]
    a =
    [x]
    [y]
    [z]

    >> X=[x,0,0;0,y,0;0,0,z]
    X =
    [x. 0. 0.]
    [0. y. 0.]
    [0. 0. z.]

    >> X*A*b+A*a
    ans =

    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  42. Ricad Alexius Barutu
    10.11.4584

    I. Exercises and Problem
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  43. Aloisius Chris Cahyo Utomo
    10.11.4563

    I. Exercises and Problem
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  44. Aloisius Chris Cahyo Utomo
    10.11.4563

    I. Exercises and Problem
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  45. NAMA : Aloisius Chris Cahyo Utomo
    NIM : 10.11.4563

    I. Exercises and Problem
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  46. Nama : Yuda Hadi Prayoko
    Kelas : 1N
    NIM : 10.11.4594

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result

  47. I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  48. I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

    • Aloisius chris cahyo utomo
      10.11.4563

      I. Exercises and Problem

      Exercises 1

      a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

      ans =

      -2 1 -1

      -1 1 1

      b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

      ans =

      4 -1

      Exercises 2

      a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
      ans =

      8 16 -8

      8 0 0

      16 -8 24

      b. >> -[2 3] + 3*[2 -1]
      ans =

      4 -6

      Exercises 3

      >> A=[1 0 -1 ; 1 1 2]
      A =

      1 0 -1

      1 1 2

      >> B=[2 2 ; 1 -2]
      B =

      2 2

      1 -2
      >> C=[1 1 0 ; 2 1 0]
      C =

      1 1 0

      2 1 0

      a. >> A+3*B
      ??? Error using ==> +
      Matrix dimensions must agree.
      >> A
      A =

      1 0 -1

      1 1 2

      >> 3*B
      ans =

      6 6

      3 -6

      b. >> 2*A – 3*C
      ans =

      -1 -3 -2

      -4 -1 4

      exercises 4

      a. >> X = C-3*A
      X =

      -2 1 3

      -1 -2 -6

      Exercises 5

      >> syms(‘x’)
      >> syms(‘y’)
      >> syms(‘z’)

      a. >> [x+2*y ; 2*x-z]
      ans =
      [ x+2*y]
      [ 2*x-z]

      Exercises 6
      >> syms(‘x’)
      >> syms(‘y’)
      >> syms(‘z’)
      >> syms(‘w’)
      a. >> [3*x+y ; x+y+z]
      ans =

      [ 3*x+y]
      [ x+y+z]

      b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
      ans =

      [ 3*x+2*y-w]
      [ w-z]
      [ x+y-2*w]

      II. Exercises and Problems

      Exercises 1

      >> a=[2;1]
      a =

      2

      1
      >> b=[3 4]

      b =

      3 4
      >> c=[2 1+i;0 -1]
      c =
      2.0000 1.0000 + 1.0000i

      0 -1.0000
      a. >> b*c*a
      ans =
      11.0000 + 3.0000i

      b. >> a*b
      ans =

      6 8

      3 4
      c. >> c*b
      ??? Error using ==> *
      Inner matrix dimensions must agree.

      Exercise 2
      a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
      ans =

      3 -2 0

      -2 5 8

      b. >> [2 1 0;0 8 2]*[1 1;2 2]
      ??? Error using ==> *
      Inner matrix dimensions must agree.

      Exercise 5
      >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
      A =

      2 -1 1

      2 3 -2

      4 2 -2
      >> b=[2 ; -3 ; 1]
      b =

      2

      -3

      1
      >> a=[x;y;z]
      a =
      [ x]
      [ y]
      [ z]
      >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
      X =
      [ x, 0, 0]
      [ 0, y, 0]
      [ 0, 0, z]
      >> X*A*b+A*a
      ans =
      [ 10*x-y+z]
      [ -4*y+2*x-2*z]
      [ 4*x+2*y-2*z]

      >> X*A*b+A*a=[3;1;2]
      ??? Error: Assignment statements cannot produce a result.

  49. I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  50. 1) >> A=[1 2 3;4 5 6]
    A =
    1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B =
    7 8 9
    0 1 2
    >> A+B
    ans =
    8 10 12
    4 6 8
    >> A-B
    ans =
    -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a =
    1 0 -1
    >> b=[4 ; 3; 2]
    b =
    4
    3
    2
    >> a*b
    ans =
    2

    3) >> A=[1 0;1 1]

    A =
    1 0
    1 1
    >> B=[2 3;4 1]
    B =
    2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C =
    1 1 2
    0 2 3
    >> A*B
    ans =
    2 3
    6 4
    >> B*A
    ans =
    5 3
    5 1
    >> A*C (DEFINED)
    ans =
    1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A =
    3 0
    0 2

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

    >> A*B
    ans =
    3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C =
    1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D =
    2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans =
    2 6 3
    8 15 6

  51. NAMA : RIAN ADI WIBOWO
    NIM : 10.11.4546

    I. Exercise and Problems

    Execise 1

    (a). >> [1 2 -1;0 2 2] – [3 1 0;1 1 1]

    ans =

    -2 1 -1
    -1 1 1

    (b). >> 2 * [1;3] – 5 * [2;2] + 3 * [4;1]

    ans =

    4
    -1

    Exercise 2

    (a). >> 8 * [1 2 -1;1 0 0;2 -1 3]

    ans =

    8 16 -8
    8 0 0
    16 -8 24

    (b). >> -[2;3] + 3 * [2;-1]

    ans =

    4
    -6

    Exercise 3

    >> A = [1 0 -1;1 1 2], B = [2 2;1 -2], C = [1 1 0;2 1 0]

    A =

    1 0 -1
    1 1 2

    B =

    2 2
    1 -2

    C =

    1 1 0
    2 1 0

    (a). >> A + 3*B
    ??? Error using ==> +
    Matrix dimensions must agree.

    (b). >> 2*A – 3*C

    ans =

    -1 -3 -2
    -4 -1 4

    Exercise 4

    >> A = [1 0 -1;1 1 2], B = [2 2;1 -2], C = [1 1 0;2 1 0]

    A =

    1 0 -1
    1 1 2

    B =

    2 2
    1 -2

    C =

    1 1 0
    2 1 0

    (a). X + 3A = C
    >> X = C – 3*A

    X =

    -2 1 3
    -1 -2 -6

    Exercise 5

    >> syms (‘x’)
    >> syms (‘y’)
    >> syms (‘z’)

    (a). >> [x+2*y;2*x-z]

    ans =

    [ x+2*y]
    [ 2*x-z]

    Exercise 6

    >> syms (‘x’)
    >> syms (‘y’)
    >> syms (‘z’)
    >> syms (‘w’)

    (a). >> [3*x+y;x+y+z]

    ans =

    [ 3*x+y]
    [ x+y+z]

    (b). >> [3*x+2*y-w;w-z;x+y+2*w]

    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y+2*w]

    Exercise 9

    II. Exercise and Problems

    Exercise 1

    >> a = [2;1], b = [3 4], C = [2 1 + i; 0 -1]

    a =

    2
    1

    b =

    3 4

    C =

    2.0000 1.0000 + 1.0000i
    0 -1.0000

    (a). >> b*C*a

    ans =

    11.0000 + 3.0000i

    (b). >> a*b

    ans =

    6 8
    3 4

    (c). >> C*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2

    (a). >> [1 0;0 1] * [3 -2 0;-2 5 8]

    ans =

    3 -2 0
    -2 5 8

    (b). >> [2 1 0;0 8 2] * [1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5

    >> A = [2 -1 1;2 3 -2;4 2 -2], b = [2;-3;1], X = [x 0 0;0 y 0;0 0 z], x = [x;y;z]

    A =

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

    b =

    2
    -3
    1

    X =

    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]

    x =

    [ x]
    [ y]
    [ z]

    >> X*A*b + A*x = [3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  52. NAMA : RIAN ADI WIBOWO
    NIM : 10.11.4546

    I. Exercise and Problems

    Execise 1

    (a). >> [1 2 -1;0 2 2] – [3 1 0;1 1 1]

    ans =

    -2 1 -1
    -1 1 1

    (b). >> 2 * [1;3] – 5 * [2;2] + 3 * [4;1]

    ans =

    4
    -1

    Exercise 2

    (a). >> 8 * [1 2 -1;1 0 0;2 -1 3]

    ans =

    8 16 -8
    8 0 0
    16 -8 24

    (b). >> -[2;3] + 3 * [2;-1]

    ans =

    4
    -6

    Exercise 3

    >> A = [1 0 -1;1 1 2], B = [2 2;1 -2], C = [1 1 0;2 1 0]

    A =

    1 0 -1
    1 1 2

    B =

    2 2
    1 -2

    C =

    1 1 0
    2 1 0

    (a). >> A + 3*B
    ??? Error using ==> +
    Matrix dimensions must agree.

    (b). >> 2*A – 3*C

    ans =

    -1 -3 -2
    -4 -1 4

    Exercise 4

    >> A = [1 0 -1;1 1 2], B = [2 2;1 -2], C = [1 1 0;2 1 0]

    A =

    1 0 -1
    1 1 2

    B =

    2 2
    1 -2

    C =

    1 1 0
    2 1 0

    (a). X + 3A = C
    >> X = C – 3*A

    X =

    -2 1 3
    -1 -2 -6

    Exercise 5

    >> syms (‘x’)
    >> syms (‘y’)
    >> syms (‘z’)

    (a). >> [x+2*y;2*x-z]

    ans =

    [ x+2*y]
    [ 2*x-z]

    Exercise 6

    >> syms (‘x’)
    >> syms (‘y’)
    >> syms (‘z’)
    >> syms (‘w’)

    (a). >> [3*x+y;x+y+z]

    ans =

    [ 3*x+y]
    [ x+y+z]

    (b). >> [3*x+2*y-w;w-z;x+y+2*w]

    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y+2*w]

    Exercise 9

    II. Exercise and Problems

    Exercise 1

    >> a = [2;1], b = [3 4], C = [2 1 + i; 0 -1]

    a =

    2
    1

    b =

    3 4

    C =

    2.0000 1.0000 + 1.0000i
    0 -1.0000

    (a). >> b*C*a

    ans =

    11.0000 + 3.0000i

    (b). >> a*b

    ans =

    6 8
    3 4

    (c). >> C*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2

    (a). >> [1 0;0 1] * [3 -2 0;-2 5 8]

    ans =

    3 -2 0
    -2 5 8

    (b). >> [2 1 0;0 8 2] * [1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5

    >> A = [2 -1 1;2 3 -2;4 2 -2], b = [2;-3;1], X = [x 0 0;0 y 0;0 0 z], x = [x;y;z]

    A =

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

    b =

    2
    -3
    1

    X =

    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]

    x =

    [ x]
    [ y]
    [ z]

    >> X*A*b + A*x = [3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  53. Nama : ALoisius Chris Cahyo Utomo
    Nim : 10.11.4563
    1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4
    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2
    3) >> A=[1 0;1 1]
    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    5) >> A=[3 0;0 2]
    A = 3 0
    0 2
    >> B=[1 2 3;4 5 6]
    B = 1 2 3
    4 5 6
    >> A*B
    ans = 3 6 9
    8 10 12
    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6
    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1
    >> C*D
    ans = 2 6 3
    8 15 6

  54. Nama : Aloisius Chris Cahyo Utomo
    NIM : 10.11.4563

    1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4
    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2
    3) >> A=[1 0;1 1]
    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    5) >> A=[3 0;0 2]
    A = 3 0
    0 2
    >> B=[1 2 3;4 5 6]
    B = 1 2 3
    4 5 6
    >> A*B
    ans = 3 6 9
    8 10 12
    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6
    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1
    >> C*D
    ans = 2 6 3
    8 15 6

  55. EXERCISES AND PROBLEM 1

    I
    no.1
    (a)
    >> A = [1 2 -1; 0 2 2]

    A =

    1 2 -1
    0 2 2

    >> B = [3 1 0; 1 1 1 ]

    B =

    3 1 0
    1 1 1

    >> A – B

    ans =

    -2 1 -1
    -1 1 1

    (b)
    >> A=[1; 3]

    A =

    1
    3

    >> B=[2; 2]

    B =

    2
    2

    >> C=[4; 1]

    C =

    4
    1

    >> D=2*A

    D =

    2
    6

    >> E=5*B

    E =

    10
    10

    >> F=3*C

    F =

    12
    3

    >> D-E+F

    ans =

    4
    -1

    no.2
    (a)
    >> A=[1 2 -1; 1 0 0; 2 -1 3]

    A =

    1 2 -1
    1 0 0
    2 -1 3

    >> 8*A

    ans =

    8 16 -8
    8 0 0
    16 -8 24

    (b)
    >> A=[2;3]

    A =

    2
    3

    >> B=[2; -1]

    B =

    2
    -1

    >> C=-1*A

    C =

    -2
    -3

    >> D=3*B

    D =

    6
    -3

    >> C+D

    ans =

    4
    -6

    no.3

    >> A=[1 0 -1; 1 1 2]

    A =

    1 0 -1
    1 1 2

    >> B=[2 2; 1 -2]

    B =

    2 2
    1 -2

    >> C=[1 1 0; 2 1 0]

    C =

    1 1 0
    2 1 0

    (a)
    >> 3*B

    ans =

    6 6
    3 -6

    >> A+(3*B)
    ??? Error using ==> +
    Matrix dimensions must agree.

    (b)
    >> 2*A

    ans =

    2 0 -2
    2 2 4

    >> 3*C

    ans =

    3 3 0
    6 3 0

    >> (2*A)-(3*C)

    ans =

    -1 -3 -2
    -4 -1 4

    No.4
    (a)
    >> A=[1 0 -1; 1 1 2]

    A =

    1 0 -1
    1 1 2

    >> B=[2 2; 1 -2]

    B =

    2 2
    1 -2

    >> C=[1 1 0; 2 1 0]

    C =

    1 1 0
    2 1 0

    X +3A=C

    >> 3*A

    ans =

    3 0 -3
    3 3 6

    >> X=C-(3*A)

    X =

    -2 1 3
    -1 -2 -6

    no.5
    (a)
    >> a = inline(‘[x + 2*y; 2*x – z]’)

    a =

    Inline function:
    a(x,y,z) = [x + 2*y; 2*x – z]

    >> a(1,2,3)

    ans =

    5
    -1

    no.6
    (a)
    >> a = inline(‘[3*x + y; x + y + z]’)

    a =

    Inline function:
    a(x,y,z) = [3*x + y; x + y + z]

    >> a(1,2,3)

    ans =

    5
    6

    (b)
    >> a = inline(‘[3*x + y; x + y + z]’)

    a =

    Inline function:
    a(x,y,z) = [3*x + y; x + y + z]

    >> a(1,2,3)

    ans =

    5
    6

    no.9
    >> a = [1 0; 0 0]

    a =

    1 0
    0 0

    >> b = [0 1; 0 0]

    b =

    0 1
    0 0

    >> c = [0 0; 1 0]

    c =

    0 0
    1 0

    >> d = [0 0; 0 1]

    d =

    0 0
    0 1

    >> gabung1=[a b; c d]

    gabung1 =

    1 0 0 1
    0 0 0 0
    0 0 0 0
    1 0 0 1

    II
    no.1

    >> a=[2; 1]

    a =

    2
    1

    >> b=[3, 4]

    b =

    3 4

    >> C=[2 1 + i; 0 -1]

    C =

    2.0000 1.0000 + 1.0000i
    0 -1.0000
    (a)
    >> b*C*a

    ans =

    11.0000 + 3.0000i
    (b)
    >> a*b

    ans =

    6 8
    3 4
    (c)
    >> C*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    no.2
    (a)
    >> a=[1 0; 0 1]

    a =

    1 0
    0 1

    >> A=[1 0; 0 1]

    A =

    1 0
    0 1

    >> B=[3 -2 0; -2 5 8]

    B =

    3 -2 0
    -2 5 8

    >> A*B

    ans =

    3 -2 0
    -2 5 8
    (b)
    >> A=[2 1 0; 0 8 2]

    A =

    2 1 0
    0 8 2

    >> B=[1 1; 2 2]

    B =

    1 1
    2 2

    >> A*B
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    no.5

    >> A = [2 -1 1; 2 3 -2; 4 2 -2]

    A =

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

    >> b = [2; -3; 1]

    b =

    2
    -3
    1

    >> x = [‘x’;’y’; ‘z’]

    x =

    x
    y
    z

    >> X = [‘x’ ‘0’ ‘0’; ‘0’ ‘y’ ‘0’; ‘0’ ‘0’ ‘z’]

    X =

    x00
    0y0
    00z

    >> j = [3; 1; 2]

    j =

    3
    1
    2

    >> %XAb + Ax = j
    >> %A(Xb + x) = j
    2 -1 1 x 0 0 2 x 3
    2 3 -2 *( 0 y 0 * -3 + y ) = 1
    4 2 -2 0 0 z 1 z 2
    >> %Xb + x = v

    x 0 0 2 x 3x
    ( 0 y 0 * – 3 + y ) = -2y
    0 0 z 1 z 2z
    >> %A*v = j

    2 -1 1 3x 3
    2 3 -2 * -2y = 1
    4 2 -2 2z 2
    >> %A*v = g
    2 -1 1 3x 6x + 2y + 2z
    2 3 -2 * -2y = 6x – 6y – 4z
    4 2 -2 2z 12x – 4y – 4z

    >> %memisahkan kostanta xyz

    6 2 2 x 3
    6 -6 -4 * y = 2
    12 -4 -4 z 1

    >> G = [6 2 2; 6 -6 -4; 12 -4 -4]

    G =

    6 2 2
    6 -6 -4
    12 -4 -4

    >> %xyz = j\G
    >> xyz = inv(G)*j

    xyz =

    0.3333
    -0.5000
    1.0000

    Happy Alfi Azizah
    10.11.4585
    TI-1N

  56. Nama : Marliya Rahmawati Yaas
    Nim : 10.11.4569

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  57. Nama : Marliya Rahmawati Yaas
    Nim : 10.11.4569

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  58. I. Exercises and Problem

    NAMA : BENI MUBAROK
    NIM : 10.11.4557

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  59. NAMA : BENI MUBAROK
    NIM : 10.11.4557

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  60. NAMA : RA Atika Diah Sitawati
    NIM : 10.11.4566

    I. Exercises and Problem
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  61. 1. NAMA : RA Atika Diah Sitawati
    NIM : 10.11.4566
    I. Exercises and Problem
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  62. NAMA : RA Atika Diah Sitawati
    NIM : 10.11.4566

    I. Exercises and Problem
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]
    ans =
    -2 1 -1
    -1 1 1
    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]
    ans =
    4 -1
    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24
    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4
    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6
    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]
    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]
    II. Exercises and Problems
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i
    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8
    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]
    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a resu

  63. NAMA : RA Atika Diah Sitawati
    NIM : 10.11.4566

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  64. I. Exercises and Problem

    NAMA : SEPTIFANI MADIANINGRUM
    NIM : 10.11.4551

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  65. Nama : Fikria Rifdania R
    NIM : 10.11.4591

    I. Exercises and Problem

    Exercises 1

    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1

    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2

    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =

    8 16 -8

    8 0 0

    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =

    4 -6

    Exercises 3

    >> A=[1 0 -1 ; 1 1 2]
    A =

    1 0 -1

    1 1 2

    >> B=[2 2 ; 1 -2]
    B =

    2 2

    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =

    1 1 0

    2 1 0

    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =

    1 0 -1

    1 1 2

    >> 3*B
    ans =

    6 6

    3 -6

    b. >> 2*A – 3*C
    ans =

    -1 -3 -2

    -4 -1 4

    exercises 4

    a. >> X = C-3*A
    X =

    -2 1 3

    -1 -2 -6

    Exercises 5

    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)

    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =

    [ 3*x+y]
    [ x+y+z]

    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =

    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    II. Exercises and Problems

    Exercises 1

    >> a=[2;1]
    a =

    2

    1
    >> b=[3 4]

    b =

    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i

    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =

    6 8

    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =

    3 -2 0

    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =

    2 -1 1

    2 3 -2

    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =

    2

    -3

    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  66. I. Exercises and Problems

    Exercise 1

    A. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1
    -1 1 1

    B. >> 2*[1 ; 3] – 5*[2 ; 2] + 3*[4 ; 1]

    ans =

    4
    -1

    Exercise 2

    A. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]

    ans =

    8 16 -8
    8 0 0
    16 -8 24

    B. >> -[2 ; 3] + 3*[2 ; -1]

    ans =

    4
    -6

    Exercise 3

    >> A=[1 0 -1 ; 1 1 2], B=[2 2 ; 1 -2], C=[1 1 0 ; 2 1 0]

    A =

    1 0 -1
    1 1 2

    B =

    2 2
    1 -2

    C =

    1 1 0
    2 1 0

    A. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.

    B. >> 2*A-3*C

    ans =

    -1 -3 -2
    -4 -1 4

    Exercise 4

    A. >> X=C-3*A

    X =

    -2 1 3
    -1 -2 -6

    Exercise 5

    A. >> syms (‘x’), syms(‘y’), syms(‘z’)
    >> [x+2*y ; 2*x-z]

    ans =

    [ x+2*y]
    [ 2*x-z ]

    Exercise 6

    A. >> syms (‘x’), syms(‘y’), syms(‘z’)
    >> [3*x+y ; x+y+z]

    ans =

    [ 3*x+y ]
    [ x+y+z ]

    Exercise 9

    ###### SAYA MASIH BINGUNG PAK ##########

    II. Exercises and Problems

    Exercise 1

    >> a=[2 ; 1], b=[3 4], C=[2 1+i ; 0 -i]

    a =

    2
    1

    b =

    3 4

    C =

    2.0000 1.0000 + 1.0000i
    0 0 – 1.0000i

    A. >> b*C*a

    ans =

    15.0000 – 1.0000i

    B. >> a*b

    ans =

    6 8
    3 4

    C. >> C*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2

    A. >> [1 0 ; 0 1] * [3 -2 0 ; -2 5 8]

    ans =

    3 -2 0
    -2 5 8

    B. >> [2 1 0 ; 0 8 2] * [1 1 ; 2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5

    ###### SAYA MASIH BINGUNG PAK ##########

  67. I. Exercises and Problems

    Exercise 1

    A. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1
    -1 1 1

    B. >> 2*[1 ; 3] – 5*[2 ; 2] + 3*[4 ; 1]

    ans =

    4
    -1

    Exercise 2

    A. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]

    ans =

    8 16 -8
    8 0 0
    16 -8 24

    B. >> -[2 ; 3] + 3*[2 ; -1]

    ans =

    4
    -6

    Exercise 3

    >> A=[1 0 -1 ; 1 1 2], B=[2 2 ; 1 -2], C=[1 1 0 ; 2 1 0]

    A =

    1 0 -1
    1 1 2

    B =

    2 2
    1 -2

    C =

    1 1 0
    2 1 0

    A. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.

    B. >> 2*A-3*C

    ans =

    -1 -3 -2
    -4 -1 4

    Exercise 4

    A. >> X=C-3*A

    X =

    -2 1 3
    -1 -2 -6

    Exercise 5

    A. >> syms (‘x’), syms(‘y’), syms(‘z’)
    >> [x+2*y ; 2*x-z]

    ans =

    [ x+2*y]
    [ 2*x-z ]

    Exercise 6

    A. >> syms (‘x’), syms(‘y’), syms(‘z’)
    >> [3*x+y ; x+y+z]

    ans =

    [ 3*x+y ]
    [ x+y+z ]

    Exercise 9

    ###### SAYA MASIH BINGUNG PAK ##########

    II. Exercises and Problems

    Exercise 1

    >> a=[2 ; 1], b=[3 4], C=[2 1+i ; 0 -i]

    a =

    2
    1

    b =

    3 4

    C =

    2.0000 1.0000 + 1.0000i
    0 0 – 1.0000i

    A. >> b*C*a

    ans =

    15.0000 – 1.0000i

    B. >> a*b

    ans =

    6 8
    3 4

    C. >> C*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2

    A. >> [1 0 ; 0 1] * [3 -2 0 ; -2 5 8]

    ans =

    3 -2 0
    -2 5 8

    B. >> [2 1 0 ; 0 8 2] * [1 1 ; 2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5

    ###### SAYA MASIH BINGUNG PAK ##########

  68. I. Exercises and Problems
    Exercises 1
    a. >> [1 2 -1 ; 0 2 2] – [3 1 0 ; 1 1 1]

    ans =

    -2 1 -1
    -1 1 1

    b. >> 2*[1 3] – 5*[2 2] + 3*[4 1]

    ans =

    4 -1

    Exercises 2
    a. >> 8*[1 2 -1 ; 1 0 0 ; 2 -1 3]
    ans =
    8 16 -8
    8 0 0
    16 -8 24

    b. >> -[2 3] + 3*[2 -1]
    ans =
    4 -6
    Exercises 3
    >> A=[1 0 -1 ; 1 1 2]
    A =
    1 0 -1
    1 1 2
    >> B=[2 2 ; 1 -2]
    B =
    2 2
    1 -2
    >> C=[1 1 0 ; 2 1 0]
    C =
    1 1 0
    2 1 0
    a. >> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.
    >> A
    A =
    1 0 -1
    1 1 2
    >> 3*B
    ans =
    6 6
    3 -6
    b. >> 2*A – 3*C
    ans =
    -1 -3 -2
    -4 -1 4

    exercises 4
    a. >> X = C-3*A
    X =
    -2 1 3
    -1 -2 -6

    Exercises 5
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    a. >> [x+2*y ; 2*x-z]
    ans =
    [ x+2*y]
    [ 2*x-z]

    Exercises 6
    >> syms(‘x’)
    >> syms(‘y’)
    >> syms(‘z’)
    >> syms(‘w’)
    a. >> [3*x+y ; x+y+z]
    ans =
    [ 3*x+y]
    [ x+y+z]
    b. >> [3*x+2*y-w ; w-z ; x+y-2*w]
    ans =
    [ 3*x+2*y-w]
    [ w-z]
    [ x+y-2*w]

    Part II
    Exercises 1
    >> a=[2;1]
    a =
    2
    1
    >> b=[3 4]
    b =
    3 4
    >> c=[2 1+i;0 -1]
    c =
    2.0000 1.0000 + 1.0000i
    0 -1.0000
    a. >> b*c*a
    ans =
    11.0000 + 3.0000i

    b. >> a*b
    ans =
    6 8
    3 4
    c. >> c*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 2
    a. >> [1 0;0 1]*[3 -2 0;-2 5 8]
    ans =
    3 -2 0
    -2 5 8

    b. >> [2 1 0;0 8 2]*[1 1;2 2]
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    Exercise 5
    >> A=[2 -1 1 ; 2 3 -2 ; 4 2 -2]
    A =
    2 -1 1
    2 3 -2
    4 2 -2
    >> b=[2 ; -3 ; 1]
    b =
    2
    -3
    1
    >> a=[x;y;z]
    a =
    [ x]
    [ y]
    [ z]
    >> X=[x 0 0 ; 0 y 0 ; 0 0 z]
    X =
    [ x, 0, 0]
    [ 0, y, 0]
    [ 0, 0, z]
    >> X*A*b+A*a
    ans =
    [ 10*x-y+z]
    [ -4*y+2*x-2*z]
    [ 4*x+2*y-2*z]

    >> X*A*b+A*a=[3;1;2]
    ??? Error: Assignment statements cannot produce a result.

  69. nama : Joko Tri Purwanto
    nim : 10.11.4561

    1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2

    3) >> A=[1 0;1 1]

    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A = 3 0
    0 2

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

    >> A*B
    ans = 3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans = 2 6 3
    8 15 6

  70. Nama : Wegig Yoga Yunanta
    NIM : 10.11.4607
    Kelas : S1 – TI 1N

    EXERCISES AND PROBLEM 1

    I
    no.1
    (a)
    >> A = [1 2 -1; 0 2 2]

    A =

    1 2 -1
    0 2 2

    >> B = [3 1 0; 1 1 1 ]

    B =

    3 1 0
    1 1 1

    >> A – B

    ans =

    -2 1 -1
    -1 1 1

    (b)
    >> A=[1; 3]

    A =

    1
    3

    >> B=[2; 2]

    B =

    2
    2

    >> C=[4; 1]

    C =

    4
    1

    >> D=2*A

    D =

    2
    6

    >> E=5*B

    E =

    10
    10

    >> F=3*C

    F =

    12
    3

    >> D-E+F

    ans =

    4
    -1

    no.2
    (a)
    >> A=[1 2 -1; 1 0 0; 2 -1 3]

    A =

    1 2 -1
    1 0 0
    2 -1 3

    >> 8*A

    ans =

    8 16 -8
    8 0 0
    16 -8 24

    (b)
    >> A=[2;3]

    A =

    2
    3

    >> B=[2; -1]

    B =

    2
    -1

    >> C=-1*A

    C =

    -2
    -3

    >> D=3*B

    D =

    6
    -3

    >> C+D

    ans =

    4
    -6

    no.3

    >> A=[1 0 -1; 1 1 2]

    A =

    1 0 -1
    1 1 2

    >> B=[2 2; 1 -2]

    B =

    2 2
    1 -2

    >> C=[1 1 0; 2 1 0]

    C =

    1 1 0
    2 1 0

    (a)
    >> 3*B

    ans =

    6 6
    3 -6

    >> A+(3*B)
    ??? Error using ==> +
    Matrix dimensions must agree.

    (b)
    >> 2*A

    ans =

    2 0 -2
    2 2 4

    >> 3*C

    ans =

    3 3 0
    6 3 0

    >> (2*A)-(3*C)

    ans =

    -1 -3 -2
    -4 -1 4

    No.4
    (a)
    >> A=[1 0 -1; 1 1 2]

    A =

    1 0 -1
    1 1 2

    >> B=[2 2; 1 -2]

    B =

    2 2
    1 -2

    >> C=[1 1 0; 2 1 0]

    C =

    1 1 0
    2 1 0

    X +3A=C

    >> 3*A

    ans =

    3 0 -3
    3 3 6

    >> X=C-(3*A)

    X =

    -2 1 3
    -1 -2 -6

    no.5
    (a)
    >> a = inline(‘[x + 2*y; 2*x – z]’)

    a =

    Inline function:
    a(x,y,z) = [x + 2*y; 2*x – z]

    >> a(1,2,3)

    ans =

    5
    -1

    no.6
    (a)
    >> a = inline(‘[3*x + y; x + y + z]’)

    a =

    Inline function:
    a(x,y,z) = [3*x + y; x + y + z]

    >> a(1,2,3)

    ans =

    5
    6

    (b)
    >> a = inline(‘[3*x + y; x + y + z]’)

    a =

    Inline function:
    a(x,y,z) = [3*x + y; x + y + z]

    >> a(1,2,3)

    ans =

    5
    6

    no.9
    >> a = [1 0; 0 0]

    a =

    1 0
    0 0

    >> b = [0 1; 0 0]

    b =

    0 1
    0 0

    >> c = [0 0; 1 0]

    c =

    0 0
    1 0

    >> d = [0 0; 0 1]

    d =

    0 0
    0 1

    >> gabung1=[a b; c d]

    gabung1 =

    1 0 0 1
    0 0 0 0
    0 0 0 0
    1 0 0 1

    II
    no.1

    >> a=[2; 1]

    a =

    2
    1

    >> b=[3, 4]

    b =

    3 4

    >> C=[2 1 + i; 0 -1]

    C =

    2.0000 1.0000 + 1.0000i
    0 -1.0000
    (a)
    >> b*C*a

    ans =

    11.0000 + 3.0000i
    (b)
    >> a*b

    ans =

    6 8
    3 4
    (c)
    >> C*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    no.2
    (a)
    >> a=[1 0; 0 1]

    a =

    1 0
    0 1

    >> A=[1 0; 0 1]

    A =

    1 0
    0 1

    >> B=[3 -2 0; -2 5 8]

    B =

    3 -2 0
    -2 5 8

    >> A*B

    ans =

    3 -2 0
    -2 5 8
    (b)
    >> A=[2 1 0; 0 8 2]

    A =

    2 1 0
    0 8 2

    >> B=[1 1; 2 2]

    B =

    1 1
    2 2

    >> A*B
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    no.5

    >> A = [2 -1 1; 2 3 -2; 4 2 -2]

    A =

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

    >> b = [2; -3; 1]

    b =

    2
    -3
    1

    >> x = [‘x’;’y’; ‘z’]

    x =

    x
    y
    z

    >> X = [‘x’ ‘0’ ‘0’; ‘0’ ‘y’ ‘0’; ‘0’ ‘0’ ‘z’]

    X =

    x00
    0y0
    00z

    >> j = [3; 1; 2]

    j =

    3
    1
    2

    >> %XAb + Ax = j
    >> %A(Xb + x) = j
    2 -1 1 x 0 0 2 x 3
    2 3 -2 *( 0 y 0 * -3 + y ) = 1
    4 2 -2 0 0 z 1 z 2
    >> %Xb + x = v

    x 0 0 2 x 3x
    ( 0 y 0 * – 3 + y ) = -2y
    0 0 z 1 z 2z
    >> %A*v = j

    2 -1 1 3x 3
    2 3 -2 * -2y = 1
    4 2 -2 2z 2
    >> %A*v = g
    2 -1 1 3x 6x + 2y + 2z
    2 3 -2 * -2y = 6x – 6y – 4z
    4 2 -2 2z 12x – 4y – 4z

    >> %memisahkan kostanta xyz

    6 2 2 x 3
    6 -6 -4 * y = 2
    12 -4 -4 z 1

    >> G = [6 2 2; 6 -6 -4; 12 -4 -4]

    G =

    6 2 2
    6 -6 -4
    12 -4 -4

    >> %xyz = j\G
    >> xyz = inv(G)*j

    xyz =

    0.3333
    -0.5000
    1.0000

  71. Nama : Wegig Yoga Yunanta
    NIM : 10.11.4607
    Kelas : S1 – TI 1N

    EXERCISES AND PROBLEM 1

    I
    no.1
    (a)
    >> A = [1 2 -1; 0 2 2]

    A =

    1 2 -1
    0 2 2

    >> B = [3 1 0; 1 1 1 ]

    B =

    3 1 0
    1 1 1

    >> A – B

    ans =

    -2 1 -1
    -1 1 1

    (b)
    >> A=[1; 3]

    A =

    1
    3

    >> B=[2; 2]

    B =

    2
    2

    >> C=[4; 1]

    C =

    4
    1

    >> D=2*A

    D =

    2
    6

    >> E=5*B

    E =

    10
    10

    >> F=3*C

    F =

    12
    3

    >> D-E+F

    ans =

    4
    -1

    no.2
    (a)
    >> A=[1 2 -1; 1 0 0; 2 -1 3]

    A =

    1 2 -1
    1 0 0
    2 -1 3

    >> 8*A

    ans =

    8 16 -8
    8 0 0
    16 -8 24

    (b)
    >> A=[2;3]

    A =

    2
    3

    >> B=[2; -1]

    B =

    2
    -1

    >> C=-1*A

    C =

    -2
    -3

    >> D=3*B

    D =

    6
    -3

    >> C+D

    ans =

    4
    -6

    no.3

    >> A=[1 0 -1; 1 1 2]

    A =

    1 0 -1
    1 1 2

    >> B=[2 2; 1 -2]

    B =

    2 2
    1 -2

    >> C=[1 1 0; 2 1 0]

    C =

    1 1 0
    2 1 0

    (a)
    >> 3*B

    ans =

    6 6
    3 -6

    >> A+(3*B)
    ??? Error using ==> +
    Matrix dimensions must agree.

    (b)
    >> 2*A

    ans =

    2 0 -2
    2 2 4

    >> 3*C

    ans =

    3 3 0
    6 3 0

    >> (2*A)-(3*C)

    ans =

    -1 -3 -2
    -4 -1 4

    No.4
    (a)
    >> A=[1 0 -1; 1 1 2]

    A =

    1 0 -1
    1 1 2

    >> B=[2 2; 1 -2]

    B =

    2 2
    1 -2

    >> C=[1 1 0; 2 1 0]

    C =

    1 1 0
    2 1 0

    X +3A=C

    >> 3*A

    ans =

    3 0 -3
    3 3 6

    >> X=C-(3*A)

    X =

    -2 1 3
    -1 -2 -6

    no.5
    (a)
    >> a = inline(‘[x + 2*y; 2*x – z]’)

    a =

    Inline function:
    a(x,y,z) = [x + 2*y; 2*x – z]

    >> a(1,2,3)

    ans =

    5
    -1

    no.6
    (a)
    >> a = inline(‘[3*x + y; x + y + z]’)

    a =

    Inline function:
    a(x,y,z) = [3*x + y; x + y + z]

    >> a(1,2,3)

    ans =

    5
    6

    (b)
    >> a = inline(‘[3*x + y; x + y + z]’)

    a =

    Inline function:
    a(x,y,z) = [3*x + y; x + y + z]

    >> a(1,2,3)

    ans =

    5
    6

    no.9
    >> a = [1 0; 0 0]

    a =

    1 0
    0 0

    >> b = [0 1; 0 0]

    b =

    0 1
    0 0

    >> c = [0 0; 1 0]

    c =

    0 0
    1 0

    >> d = [0 0; 0 1]

    d =

    0 0
    0 1

    >> gabung1=[a b; c d]

    gabung1 =

    1 0 0 1
    0 0 0 0
    0 0 0 0
    1 0 0 1

    II
    no.1

    >> a=[2; 1]

    a =

    2
    1

    >> b=[3, 4]

    b =

    3 4

    >> C=[2 1 + i; 0 -1]

    C =

    2.0000 1.0000 + 1.0000i
    0 -1.0000
    (a)
    >> b*C*a

    ans =

    11.0000 + 3.0000i
    (b)
    >> a*b

    ans =

    6 8
    3 4
    (c)
    >> C*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    no.2
    (a)
    >> a=[1 0; 0 1]

    a =

    1 0
    0 1

    >> A=[1 0; 0 1]

    A =

    1 0
    0 1

    >> B=[3 -2 0; -2 5 8]

    B =

    3 -2 0
    -2 5 8

    >> A*B

    ans =

    3 -2 0
    -2 5 8
    (b)
    >> A=[2 1 0; 0 8 2]

    A =

    2 1 0
    0 8 2

    >> B=[1 1; 2 2]

    B =

    1 1
    2 2

    >> A*B
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    no.5

  72. beni mubarok
    10.11.4557

    1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2

    3) >> A=[1 0;1 1]

    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A = 3 0
    0 2

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

    >> A*B
    ans = 3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans = 2 6 3
    8 15 6

  73. angga yoga
    10.11.4602
    1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2

    3) >> A=[1 0;1 1]

    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A = 3 0
    0 2

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

    >> A*B
    ans = 3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans = 2 6 3
    8 15 6

  74. adhi bowo
    10.11.4609
    1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2

    3) >> A=[1 0;1 1]

    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A = 3 0
    0 2

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

    >> A*B
    ans = 3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans = 2 6 3
    8 15 6

  75. asep setia permana
    10,11,45,88
    1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2

    3) >> A=[1 0;1 1]

    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A = 3 0
    0 2

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

    >> A*B
    ans = 3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans = 2 6 3
    8 15 6

  76. Nama: Agung Oktafiyanto
    Nim: 10.11.4608
    1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2

    3) >> A=[1 0;1 1]

    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A = 3 0
    0 2

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

    >> A*B
    ans = 3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans = 2 6 3
    8 15 6

  77. I
    1. (a)
    >> a=[1, 2, -1; 0, 2, 2]

    a =

    1 2 -1
    0 2 2

    >> b=[3, 1, 0; 1, 1, 1]

    b =

    3 1 0
    1 1 1

    >> a-b

    ans =

    -2 1 -1
    -1 1 1

    (b)
    >> a=[1;3]

    a =

    1
    3

    >> b=[2;2]

    b =

    2
    2

    >> c=[4;1]

    c =

    4
    1

    >> 2*a-5*b+3*c

    ans =

    4
    -1
    2(a)
    >> a=[1, 2, -1; 1, 0, 0; 2, -1, 3]

    a =

    1 2 -1
    1 0 0
    2 -1 3

    >> 8*a

    ans =

    8 16 -8
    8 0 0
    16 -8 24
    (b)
    >> a=[2;3]

    a =

    2
    3

    >> b=[2;-1]

    b =

    2
    -1

    >> -a+3*b

    ans =

    4
    -6
    3
    >> A=[1, 0, -1; 1, 1, 2]

    A =

    1 0 -1
    1 1 2

    >> B=[2, 2; 1, -2]

    B =

    2 2
    1 -2

    >> C=[1, 1, 0; 2, 1, 0]

    C =

    1 1 0
    2 1 0

    (a)>> A+3*B
    ??? Error using ==> +
    Matrix dimensions must agree.

    (b)>> 2*A-3*C

    ans =

    -1 -3 -2
    -4 -1 4
    4
    >> C-3*A

    ans =

    -2 1 3
    -1 -2 -6
    5
    9
    >> a=[1,0;0,0]

    a =

    1 0
    0 0

    >> b=[0,1;0,0]

    b =

    0 1
    0 0

    >> c=[0,0;1,0]

    c =

    0 0
    1 0

    >> d=[0,0;0,1]

    d =

    0 0
    0 1

    >> e=[a,b;c,d]

    e =

    1 0 0 1
    0 0 0 0
    0 0 0 0
    1 0 0 1

    >>
    II
    1
    >> a=[2;1]

    a =

    2
    1

    >> b=[3, 4]

    b =

    3 4
    >> C=[21, +i; 0, 1]

    C =

    21.0000 0 + 1.0000i
    0 1.0000
    (a) >> b*C*a

    ans =

    1.3000e+002 +3.0000e+000i
    (b)
    >> a*b

    ans =

    6 8
    3 4
    (c)
    >> C*b
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    2
    (a)
    >> A=[1,0;0,1]

    A =

    1 0
    0 1

    >> B=[3,-2,0;-2,5,8]

    B =

    3 -2 0
    -2 5 8

    >> A*B

    ans =

    3 -2 0
    -2 5 8
    (b)
    >> A=[2,1,0;0,8,2]

    A =

    2 1 0
    0 8 2

    >> B=[1,1;2,2]

    B =

    1 1
    2 2

    >> A*B
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    >>

  78. Nama: Badri Dzuja
    NIM : 10.11.4573
    KLS :S1 TI N
    With MATLAB 5.3
    1.
    » A=[1 2 3;4 5 6]

    A =

    1 2 3
    4 5 6

    » B=[7 8 9;0 1 2]

    B =

    7 8 9
    0 1 2

    » A+B

    ans =

    8 10 12
    4 6 8

    » A-B

    ans =

    -6 -6 -6
    4 4 4

    2.
    » a=[1 0 -1]

    a =

    1 0 -1

    » b=[4 ; 3; 2]

    b =

    4
    3
    2

    » a*b

    ans =

    2

    3.
    » A=[1 0;1 1]

    A =

    1 0
    1 1

    » B=[2 3;4 1]

    B =

    2 3
    4 1

    » C=[1 1 2;0 2 3]

    C =

    1 1 2
    0 2 3
    » A*B

    ans =

    2 3
    6 4

    » B*A

    ans =

    5 3
    5 1

    » A*C

    ans =

    1 1 2
    1 3 5

    » C*A
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5.
    » A=[3 0;0 2]

    A =

    3 0
    0 2

    » B=[1 2 3;4 5 6]

    B =

    1 2 3
    4 5 6

    » A*B

    ans =

    3 6 9
    8 10 12
    » C=[1 2 3;4 5 6]

    C =

    1 2 3
    4 5 6

    » D=[2 0 0;0 3 0;0 0 1]

    D =

    2 0 0
    0 3 0
    0 0 1

    » C*D

    ans =

    2 6 3
    8 15 6

  79. Nama : WAAHID S.NOOR RIDWAN
    NIM : 10.11.4575
    kelas: S1-TI-1N
    MATLAB 7.10

    no 1)

    >> a=[1 2 3;4 5 6]

    a =

    1 2 3
    4 5 6

    >> b=[7 8 9;0 1 2]

    b =

    7 8 9
    0 1 2

    jawaban
    >> a+b

    ans =

    8 10 12
    4 6 8

    >> a-b

    ans =

    -6 -6 -6
    4 4 4

    no 2)
    >> a= [1 0 -1]

    a =

    1 0 -1

    >> b= [4;3;2]

    b =

    4
    3
    2

    jawaban
    >> a*b

    ans =

    2

    no 3)
    >>A=[1 0;1 1]

    A =

    1 0
    1 1

    >> B=[2 3;4 1]

    B =

    2 3
    4 1

    >> C=[1 1 2;0 2 3]

    C =

    1 1 2
    0 2 3

    jawaban
    >> A*B

    ans =

    2 3
    6 4

    >> B*A

    ans =

    5 3
    5 1

    >> A*C

    ans =

    1 1 2
    1 3 5

    >> B*C

    ans =

    2 8 13
    4 6 11

    no 4)
    >> [3 0;0 2]*[1 2 3;4 5 6]

    jawaban
    ans =

    3 6 9
    8 10 12

    >> [1 2 3;4 5 6]*[2 0 0;0 3 0;0 0 1]

    jawaban
    ans =

    2 6 3
    8 15 6

  80. FAIZAL ARIFIN
    10.11.4610
    S1-TI-1N
    1) >> a=[1 2 3;4 5 6]
    a =
    1 2 3
    4 5 6
    >> b=[7 8 9;0 1 2]
    b =
    7 8 9
    0 1 2
    >> a+b
    ans =
    8 10 12
    4 6 8
    >> a-b
    ans =
    -6 -6 -6
    4 4 4
    2) >> a= [1 0 -1]
    a =
    1 0 -1
    >> b= [4;3;2]
    b =
    4
    3
    2
    >> a*b
    ans =
    2
    3) >>A=[1 0;1 1]
    A =
    1 0
    1 1
    >> B=[2 3;4 1]
    B =
    2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C =
    1 1 2
    0 2 3
    >> A*B
    ans =
    2 3
    6 4
    >> B*A
    ans =
    5 3
    5 1
    >> A*C
    ans =
    1 1 2
    1 3 5
    >> B*C
    ans =
    2 8 13 4 6 11
    4) >> [3 0;0 2]*[1 2 3;4 5 6]
    ans =
    3 6 9
    8 10 12
    >> [1 2 3;4 5 6]*[2 0 0;0 3 0;0 0 1]
    ans =
    2 6 3
    8 15 6

  81. Nama : Robinsonlin Simbolon
    Nim : 10.11.4600
    Jur : S1-TI 1N

    No.1
    >> A = [1,2,3;4,5,6]

    …A =

    1 2 3

    4 5 6

    >> B = [7,8,9;0,1,2]

    B =

    7 8 9

    0 1 2

    >> A+B

    ans =

    8 10 12

    4 6 8

    >> A-B

    ans =

    -6 -6 -6

    4 4 4

    No.2
    >> a=[1,0,-1]

    a =

    1 0 -1

    >> b=[4;3;2]

    b =

    4

    3

    2

    >> a*b

    ans =

    2

    No.3
    >> A = [1,0;1,1]

    A =

    1 0

    1 1

    >> B = [2,3;4,1]

    B =

    2 3

    4 1

    >> C = [1,1,2;0,2,3]

    C =

    1 1 2

    0 2 3

    >> A*B

    ans =

    2 3

    6 4

    >> B*A

    ans =

    5 3

    5 1

    >> A*C

    ans =

    1 1 2

    1 3 5

    >> C*A
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    No.5
    >> A=[3,0;0,2]

    A =

    3 0

    0 2

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

    B =

    1 2 3

    4 5 6

    >> A*B

    ans =

    3 6 9

    8 10 12

    >> C=[2,0,0;0,3,0;0,0,1]

    C =

    2 0 0

    0 3 0

    0 0 1

    >> B*C

    ans =

    2 6 3

    8 15 6

  82. 1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2

    3) >> A=[1 0;1 1]

    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A = 3 0
    0 2

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

    >> A*B
    ans = 3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans = 2 6 3
    8 15 6

  83. 1)>> a=[1 2 3;4 5 6]

    a =

    1 2 3

    4 5 6

    >> b=[7 8 9;0 1 2]

    b =

    7 8 9

    0 1 2

    >> a+b

    ans =

    8 10 12

    4 6 8

    >> a-b

    ans =

    -6 -6 -6

    4 4 4

    2)>> a= [1 0 -1]

    a =

    1 0 -1

    >> b= [4;3;2]

    b =

    4

    3

    2

    >> a*b

    ans =

    2

    3)>>A=[1 0;1 1]

    A =

    1 0

    1 1

    >> B=[2 3;4 1]

    B =

    2 3

    4 1

    >> C=[1 1 2;0 2 3]

    C =

    1 1 2

    0 2 3

    >> A*B

    ans =

    2 3

    6 4

    >> B*A

    ans =

    5 3

    5 1

    >> A*C

    ans =

    1 1 2

    1 3 5

    >> B*C

    ans =

    2 8 13 4 6 11

    4)>> [3 0;0 2]*[1 2 3;4 5 6]

    ans =

    3 6 9

    8 10 12

    >> [1 2 3;4 5 6]*[2 0 0;0 3 0;0 0 1]

    ans =

    2 6 3

    8 15 6

  84. NIM : 10.11.4599

    1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2

    3) >> A=[1 0;1 1]

    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A = 3 0
    0 2

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

    >> A*B
    ans = 3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans = 2 6 3
    8 15 6

  85. 1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2

    3) >> A=[1 0;1 1]

    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A = 3 0
    0 2

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

    >> A*B
    ans = 3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans = 2 6 3
    8 15 6

  86. 1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2

    3) >> A=[1 0;1 1]

    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A = 3 0
    0 2

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

    >> A*B
    ans = 3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans = 2 6 3
    8 15 6

  87. 1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2

    3) >> A=[1 0;1 1]

    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A = 3 0
    0 2

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

    >> A*B
    ans = 3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans = 2 6 3
    8 15 6

  88. 1.)

    >> A=[1 2 3 ; 4 5 6]
    A =
    1 2 3
    4 5 6
    >> B=[7 8 9 ; 0 1 2]
    B =
    7 8 9
    0 1 2
    >> A+B
    ans =
    8 10 12
    4 6 8
    >> A-B
    ans =
    -6 -6 -6
    4 4 4

    2.)

    >> A=[1 0 1]
    A=
    1 0 -1
    >> B=[4; 3; 2]
    B =
    4
    3
    2

    >> A*B ans =
    2

    3.)

    >> A=[1 0; 1 1]
    A =
    1 0
    1 1
    >> B=[2 3; 4 1]
    B =
    2 3
    4 1
    >> C=[1 1 2; 0 2 3]
    C =
    1 1 2
    0 2 3
    >> A*B
    ans =
    2 3
    6 4
    >> B*A
    ans =
    5 3
    5 1
    >> A*C
    ans =
    1 1 2
    1 3 5
    >> C*A
    ??? Error using
    ==> mtimesInner matrix dimensions must agree.

    5.)
    >> A=[3 0; 0 2]
    A =
    3 0
    0 2
    >> B=[1 2 3; 4 5 6]
    B =
    1 2 3
    4 5 6
    >> C=[2 0 0; 0 3 0; 0 0 1]
    C =
    2 0 0
    0 3 0
    0 0 1
    >> A*B
    ans =
    3 6 9
    8 10 12
    >> B*C
    ans =
    2 6 3
    8 15 6

  89. Nama: Anggga Virgian J
    NIM:10.11.4550
    Kelas: S1 TI 1N

    Jawaban:
    No.1
    >> A = [1,2,3;4,5,6];

    A =

    1 2 3

    4 5 6

    >> B = [7,8,9;0,1,2];

    B =

    7 8 9

    0 1 2

    >> A+B;

    ans =

    8 10 12

    4 6 8

    >> A-B;

    ans =

    -6 -6 -6

    4 4 4

    No.2
    >> a=[1,0,-1];

    a =

    1 0 -1

    >> b=[4;3;2];

    b =

    4

    3

    2

    >> a*b;

    ans =

    2

    No.3
    >> A = [1,0;1,1];

    A =

    1 0

    1 1

    >> B = [2,3;4,1];

    B =

    2 3

    4 1

    >> C = [1,1,2;0,2,3];

    C =

    1 1 2

    0 2 3

    >> A*B;

    ans =

    2 3

    6 4

    >> B*A;

    ans =

    5 3

    5 1

    >> A*C;

    ans =

    1 1 2

    1 3 5

    >> C*A;
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    No.5
    >> A=[3,0;0,2];

    A =

    3 0

    0 2

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

    B =

    1 2 3

    4 5 6

    >> A*B;

    ans =

    3 6 9

    8 10 12

    >> C=[2,0,0;0,3,0;0,0,1];

    C =

    2 0 0

    0 3 0

    0 0 1

    >> B*C;

    ans =

    2 6 3

    8 15 6

  90. Nama: Rendi Fajar Kumala
    NIM: 10.11.4572
    Kelas: S1 TI 1N

    Jawaban:
    No.1
    >> A = [1,2,3;4,5,6];

    A =

    1 2 3

    4 5 6

    >> B = [7,8,9;0,1,2];

    B =

    7 8 9

    0 1 2

    >> A+B;

    ans =

    8 10 12

    4 6 8

    >> A-B;

    ans =

    -6 -6 -6

    4 4 4

    No.2
    >> a=[1,0,-1];

    a =

    1 0 -1

    >> b=[4;3;2];

    b =

    4

    3

    2

    >> a*b;

    ans =

    2

    No.3
    >> A = [1,0;1,1];

    A =

    1 0

    1 1

    >> B = [2,3;4,1];

    B =

    2 3

    4 1

    >> C = [1,1,2;0,2,3];

    C =

    1 1 2

    0 2 3

    >> A*B;

    ans =

    2 3

    6 4

    >> B*A;

    ans =

    5 3

    5 1

    >> A*C;

    ans =

    1 1 2

    1 3 5

    >> C*A;
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    No.5
    >> A=[3,0;0,2];

    A =

    3 0

    0 2

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

    B =

    1 2 3

    4 5 6

    >> A*B;

    ans =

    3 6 9

    8 10 12

    >> C=[2,0,0;0,3,0;0,0,1];

    C =

    2 0 0

    0 3 0

    0 0 1

    >> B*C;

    ans =

    2 6 3

    8 15 6

  91. Nama: Emanuel Tegar Wibisono
    NIM: 10.11.4562
    Kelas: S1 TI 1N

    Jawaban:
    No.1
    >> A = [1,2,3;4,5,6];

    A =

    1 2 3

    4 5 6

    >> B = [7,8,9;0,1,2];

    B =

    7 8 9

    0 1 2

    >> A+B;

    ans =

    8 10 12

    4 6 8

    >> A-B;

    ans =

    -6 -6 -6

    4 4 4

    No.2
    >> a=[1,0,-1];

    a =

    1 0 -1

    >> b=[4;3;2];

    b =

    4

    3

    2

    >> a*b;

    ans =

    2

    No.3
    >> A = [1,0;1,1];

    A =

    1 0

    1 1

    >> B = [2,3;4,1];

    B =

    2 3

    4 1

    >> C = [1,1,2;0,2,3];

    C =

    1 1 2

    0 2 3

    >> A*B;

    ans =

    2 3

    6 4

    >> B*A;

    ans =

    5 3

    5 1

    >> A*C;

    ans =

    1 1 2

    1 3 5

    >> C*A;
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    No.5
    >> A=[3,0;0,2];

    A =

    3 0

    0 2

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

    B =

    1 2 3

    4 5 6

    >> A*B;

    ans =

    3 6 9

    8 10 12

    >> C=[2,0,0;0,3,0;0,0,1];

    C =

    2 0 0

    0 3 0

    0 0 1

    >> B*C;

    ans =

    2 6 3

    8 15 6

  92. Nama: Emanuel Tegar Wibisono
    NIM: 10.11.4562
    Kelas S1 TI 1N

    Jawaban:

    No.1
    >> A = [1,2,3;4,5,6];

    A =

    1 2 3

    4 5 6

    >> B = [7,8,9;0,1,2];

    B =

    7 8 9

    0 1 2

    >> A+B;

    ans =

    8 10 12

    4 6 8

    >> A-B;

    ans =

    -6 -6 -6

    4 4 4

    No.2
    >> a=[1,0,-1];

    a =

    1 0 -1

    >> b=[4;3;2];

    b =

    4

    3

    2

    >> a*b;

    ans =

    2

    No.3
    >> A = [1,0;1,1];

    A =

    1 0

    1 1

    >> B = [2,3;4,1];

    B =

    2 3

    4 1

    >> C = [1,1,2;0,2,3];

    C =

    1 1 2

    0 2 3

    >> A*B;

    ans =

    2 3

    6 4

    >> B*A;

    ans =

    5 3

    5 1

    >> A*C;

    ans =

    1 1 2

    1 3 5

    >> C*A;
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    No.5
    >> A=[3,0;0,2];

    A =

    3 0

    0 2

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

    B =

    1 2 3

    4 5 6

    >> A*B;

    ans =

    3 6 9

    8 10 12

    >> C=[2,0,0;0,3,0;0,0,1];

    C =

    2 0 0

    0 3 0

    0 0 1

    >> B*C;

    ans =

    2 6 3

    8 15 6

  93. #

    no 1)
    >> a=[1 2 3;4 5 6]

    a =

    1 2 3
    4 5 6

    >> b=[7 8 9;0 1 2]

    b =

    7 8 9
    0 1 2

    jawaban
    >> a+b

    ans =

    8 10 12
    4 6 8

    >> a-b

    ans =

    -6 -6 -6
    4 4 4

    no 2)
    >> a= [1 0 -1]

    a =

    1 0 -1

    >> b= [4;3;2]

    b =

    4
    3
    2

    jawaban
    >> a*b

    ans =

    2

    no 3)
    >>A=[1 0;1 1]

    A =

    1 0
    1 1

    >> B=[2 3;4 1]

    B =

    2 3
    4 1

    >> C=[1 1 2;0 2 3]

    C =

    1 1 2
    0 2 3

    jawaban
    >> A*B

    ans =

    2 3
    6 4

    >> B*A

    ans =

    5 3
    5 1

    >> A*C

    ans =

    1 1 2
    1 3 5

    >> B*C

    ans =

    2 8 13
    4 6 11

    no 4)
    >> [3 0;0 2]*[1 2 3;4 5 6]

    jawaban
    ans =

    3 6 9
    8 10 12

    >> [1 2 3;4 5 6]*[2 0 0;0 3 0;0 0 1]

    jawaban
    ans =

    2 6 3
    8 15 6

    Jika ada kesalhan,mohon konfirmasi ya pak. terima kasih.
    Reply
    #
    Dwi Prasetyo Wibowo, on 26/10/2010 at 1:25 am Said:
    0
    0

    i

    Rate This

    Quantcast

    Nama : Dwi Prasetyo Wibowo
    NIM : 10.11.4471
    Kelas : S1 TI 1-M

    To get started, select “MATLAB Help” from the Help menu.

    1.>> a=[1 2 3;4 5 6]

    a =

    1 2 3
    4 5 6

    >> b=[7 8 9;0 1 2]

    b =

    7 8 9
    0 1 2

    >> a+b

    ans =

    8 10 12
    4 6 8

    >> a-b

    ans =

    -6 -6 -6
    4 4 4

    2.>> a=[1 0 -1]

    a =

    1 0 -1

    >> b=[4;3;2]

    b =

    4
    3
    2

    >> a*b

    ans =

    2

    3.>> a=[1 0;1 1]

    a =

    1 0
    1 1

    >> b=[2 3;4 1]

    b =

    2 3
    4 1

    >> c=[1 1 2;0 2 3]

    c =

    1 1 2
    0 2 3

    >> a*b

    ans =

    2 3
    6 4

    >> b*a

    ans =

    5 3
    5 1

    >> a*c

    ans =

    1 1 2
    1 3 5

    >> c*a
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5.>> a=[3 0;0 2]

    a =

    3 0
    0 2

    >> b=[1 2 3;4 5 6]

    b =

    1 2 3
    4 5 6

    >> c=[2 0 0;0 3 0;0 0 1]

    c =

    2 0 0
    0 3 0
    0 0 1

    >> a*b

    ans =

    3 6 9
    8 10 12

    >> b*c

    ans =

    2 6 3
    8 15 6
    Reply
    #
    Faldi Dwi Hastiya, on 26/10/2010 at 1:32 am Said:
    0
    0

    i

    Rate This

    Quantcast

    Nama : Faldi Dwi Hastiya
    NIM : 10.11.4523
    Kelas : S1 Ti 1M
    To get started, select “MATLAB Help” from the Help menu.

    1.>> a=[1 2 3;4 5 6]

    a =

    1 2 3
    4 5 6

    >> b=[7 8 9;0 1 2]

    b =

    7 8 9
    0 1 2

    >> a+b

    ans =

    8 10 12
    4 6 8

    >> a-b

    ans =

    -6 -6 -6
    4 4 4

    2.>> a=[1 0 -1]

    a =

    1 0 -1

    >> b=[4;3;2]

    b =

    4
    3
    2

    >> a*b

    ans =

    2

    3.>> a=[1 0;1 1]

    a =

    1 0
    1 1

    >> b=[2 3;4 1]

    b =

    2 3
    4 1

    >> c=[1 1 2;0 2 3]

    c =

    1 1 2
    0 2 3

    >> a*b

    ans =

    2 3
    6 4

    >> b*a

    ans =

    5 3
    5 1

    >> a*c

    ans =

    1 1 2
    1 3 5

    >> c*a
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5.>> a=[3 0;0 2]

    a =

    3 0
    0 2

    >> b=[1 2 3;4 5 6]

    b =

    1 2 3
    4 5 6

    >> c=[2 0 0;0 3 0;0 0 1]

    c =

    2 0 0
    0 3 0
    0 0 1

    >> a*b

    ans =

    3 6 9
    8 10 12

    >> b*c

    ans =

    2 6 3
    8 15 6
    Reply
    #
    Beni Viktor, on 26/10/2010 at 1:37 am Said:
    0
    0

    i

    Rate This

    Quantcast

    Nama : Beni Viktor
    NIM : 10.11.4480
    Kelas : S1 TI 1M

    To get started, select “MATLAB Help” from the Help menu.

    1.>> a=[1 2 3;4 5 6]

    a =

    1 2 3
    4 5 6

    >> b=[7 8 9;0 1 2]

    b =

    7 8 9
    0 1 2

    >> a+b

    ans =

    8 10 12
    4 6 8

    >> a-b

    ans =

    -6 -6 -6
    4 4 4

    2.>> a=[1 0 -1]

    a =

    1 0 -1

    >> b=[4;3;2]

    b =

    4
    3
    2

    >> a*b

    ans =

    2

    3.>> a=[1 0;1 1]

    a =

    1 0
    1 1

    >> b=[2 3;4 1]

    b =

    2 3
    4 1

    >> c=[1 1 2;0 2 3]

    c =

    1 1 2
    0 2 3

    >> a*b

    ans =

    2 3
    6 4

    >> b*a

    ans =

    5 3
    5 1

    >> a*c

    ans =

    1 1 2
    1 3 5

    >> c*a
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5.>> a=[3 0;0 2]

    a =

    3 0
    0 2

    >> b=[1 2 3;4 5 6]

    b =

    1 2 3
    4 5 6

    >> c=[2 0 0;0 3 0;0 0 1]

    c =

    2 0 0
    0 3 0
    0 0 1

    >> a*b

    ans =

    3 6 9
    8 10 12

    >> b*c

    ans =

    2 6 3
    8 15 6
    Reply
    #
    eko wahyu nugroho, on 26/10/2010 at 1:40 am Said:
    0
    0

    i

    Rate This

    Quantcast

    eko wahyu nugroho
    10.11.4468
    s1 TI 1M

    To get started, select “MATLAB Help” from the Help menu.

    >> a=[1 2 3;4 5 6]

    a =

    1 2 3
    4 5 6

    >> b=[7 8 9;0 1 2]

    b =

    7 8 9
    0 1 2

    >> a+b

    ans =

    8 10 12
    4 6 8

    >> a-b

    ans =

    -6 -6 -6
    4 4 4

    >> a=[1 0 -1]

    a =

    1 0 -1

    >> b=[4;3;2]

    b =

    4
    3
    2

    >> a*b

    ans =

    2

    >> a=[1 0;1 1]

    a =

    1 0
    1 1

    >> b=[2 3;4 1]

    b =

    2 3
    4 1

    >> c=[1 1 2;0 2 3]

    c =

    1 1 2
    0 2 3

    >> a*b

    ans =

    2 3
    6 4

    >> b*a

    ans =

    5 3
    5 1

    >> a*c

    ans =

    1 1 2
    1 3 5

    >> c*a
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    >> a=[3 0;0 2]

    a =

    3 0
    0 2

    >> b=[1 2 3;4 5 6]

    b =

    1 2 3
    4 5 6

    >> c=[2 0 0;0 3 0;0 0 1]

    c =

    2 0 0
    0 3 0
    0 0 1

    >> a*b

    ans =

    3 6 9
    8 10 12

    >> b*c

    ans =

    2 6 3
    8 15 6
    Reply

  94. FAJAR NURHFI ILSAN
    10.11.4574

    1.) >> A = [123;456]
    A =
    123
    456
    >> B=[789;012]
    789
    012
    >> A+B
    ans =
    8 10 12
    4 6 8
    >> A-B
    ans =
    -6 -6 -6
    4 4 4

    2.) >> A=[1 0 1]
    A = 1 0 -1
    >> B [4;3;2]
    B =
    4
    3
    2
    >> A*B ans =
    2

    3.) >> A= [1 0; 1 1]
    A =
    1 0
    1 1
    >> B=[2 3;4 1]
    B =
    2 3
    4 1
    >> C = [1 1 2; 0 2 3 ]
    C =
    1 1 2
    0 2 3
    >>A*B
    ans=
    2 3
    6 4
    >>B*A
    ans =
    5 3
    5 1
    >> A*C
    ans =
    1 1 2
    1 3 5
    >> C*A
    ??? Error using
    ==>mtimesInner matrix dimensions must agreee

    5.)
    >> A=[3 0; 02]
    A =
    3 0
    0 2
    >> B=[1 2 3;4 5 6]
    B =
    1 2 3
    4 5 6
    >> C=[2 0 0;0 3 0;0 0 1]
    C =
    2 0 0
    0 3 0
    0 0 1
    >> A*B
    ans =
    3 6 9
    8 10 12
    >> B*C
    ans =
    2 6 3
    8 15 6

    NAMA : Fajar Nurhfi Ilsan
    NIM : 10.11.4574
    S!z

  95. FAJAR NURHFI ILSAN
    10.11.4574

    1.) >> A = [123;456]
    A =
    123
    456
    >> B=[789;012]
    789
    012
    >> A+B
    ans =
    8 10 12
    4 6 8
    >> A-B
    ans =
    -6 -6 -6
    4 4 4

    2.) >> A=[1 0 1]
    A = 1 0 -1
    >> B [4;3;2]
    B =
    4
    3
    2
    >> A*B ans =
    2

    3.) >> A= [1 0; 1 1]
    A =
    1 0
    1 1
    >> B=[2 3;4 1]
    B =
    2 3
    4 1
    >> C = [1 1 2; 0 2 3 ]
    C =
    1 1 2
    0 2 3
    >>A*B
    ans=
    2 3
    6 4
    >>B*A
    ans =
    5 3
    5 1
    >> A*C
    ans =
    1 1 2
    1 3 5
    >> C*A
    ??? Error using
    ==>mtimesInner matrix dimensions must agreee

    5.)

    >> A=[3 0; 0 2]
    A =
    3 0
    0 2
    >> B=[1 2 3; 4 5 6]
    B =
    1 2 3
    4 5 6
    >> C=[2 0 0; 0 3 0; 0 0 1]
    C =
    2 0 0
    0 3 0
    0 0 1
    >> A*B
    ans =
    3 6 9
    8 10 12
    >> B*C
    ans =
    2 6 3
    8 15 6

    NAMA : Fajar Nurhfi Ilsan
    NIM : 10.11.4574
    S!z

  96. 1.) >> A = [123;456]
    A =
    123
    456
    >> B=[789;012]
    789
    012
    >> A+B
    ans =
    8 10 12
    4 6 8
    >> A-B
    ans =
    -6 -6 -6
    4 4 4

    2.) >> A=[1 0 1]
    A = 1 0 -1
    >> B [4;3;2]
    B =
    4
    3
    2
    >> A*B ans =
    2

    3.) >> A= [1 0; 1 1]
    A =
    1 0
    1 1
    >> B=[2 3;4 1]
    B =
    2 3
    4 1
    >> C = [1 1 2; 0 2 3 ]
    C =
    1 1 2
    0 2 3
    >>A*B
    ans=
    2 3
    6 4
    >>B*A
    ans =
    5 3
    5 1
    >> A*C
    ans =
    1 1 2
    1 3 5
    >> C*A
    ??? Error using
    ==>mtimesInner matrix dimensions must agreee

    5.)

    >> A=[3 0; 0 2]
    A =
    3 0
    0 2
    >> B=[1 2 3; 4 5 6]
    B =
    1 2 3
    4 5 6
    >> C=[2 0 0; 0 3 0; 0 0 1]
    C =
    2 0 0
    0 3 0
    0 0 1
    >> A*B
    ans =
    3 6 9
    8 10 12
    >> B*C
    ans =
    2 6 3
    8 15 6

    NAMA : Fajar Nurhfi Ilsan
    NIM : 10.11.4574
    S!z

  97. 1.) >> A=[1 2 3 ; 4 5 6]
    A =
    1 2 3
    4 5 6
    >> B=[7 8 9 ; 0 1 2]
    B =
    7 8 9
    0 1 2
    >> A+B
    ans =
    8 10 12
    4 6 8
    >> A-B
    ans =
    -6 -6 -6
    4 4 4

    2.) >> A=[1 0 1]
    A=
    1 0 -1
    >> B=[4; 3; 2]
    B =
    4
    3
    2

    >> A*B ans =2

    3.)>> A=[1 0; 1 1]
    A =
    1 0
    1 1
    >> B=[2 3; 4 1]
    B =
    2 3
    4 1
    >> C=[1 1 2; 0 2 3]
    C =
    1 1 2
    0 2 3
    >> A*B
    ans =
    2 3
    6 4
    >> B*A
    ans =
    5 3
    5 1
    >> A*C
    ans =
    1 1 2
    1 3 5
    >> C*A
    ??? Error using
    ==> mtimesInner matrix dimensions must agree.

    5.)
    >> A=[3 0; 0 2]
    A =
    3 0
    0 2
    >> B=[1 2 3; 4 5 6]
    B =
    1 2 3
    4 5 6
    >> C=[2 0 0; 0 3 0; 0 0 1]
    C =
    2 0 0
    0 3 0
    0 0 1
    >> A*B
    ans =
    3 6 9
    8 10 12
    >> B*C
    ans =
    2 6 3
    8 15 6

    NAMA : Fajar Nurhfi Ilsan
    NIM : 10.11.4574
    S1TI-1N

  98. 1.) >> A=[1 2 3 ; 4 5 6]
    A =
    1 2 3
    4 5 6
    >> B=[7 8 9 ; 0 1 2]
    B =
    7 8 9
    0 1 2
    >> A+B
    ans =
    8 10 12
    4 6 8
    >> A-B
    ans =
    -6 -6 -6
    4 4 4

    2.) >> A=[1 0 1]
    A=
    1 0 -1
    >> B=[4; 3; 2]
    B =
    4
    3
    2

    >> A*B ans =2

    3.)>> A=[1 0; 1 1]
    A =
    1 0
    1 1
    >> B=[2 3; 4 1]
    B =
    2 3
    4 1
    >> C=[1 1 2; 0 2 3]
    C =
    1 1 2
    0 2 3
    >> A*B
    ans =
    2 3
    6 4
    >> B*A
    ans =
    5 3
    5 1
    >> A*C
    ans =
    1 1 2
    1 3 5
    >> C*A
    ??? Error using
    ==> mtimesInner matrix dimensions must agree.

    5.)
    >> A=[3 0; 0 2]
    A =
    3 0
    0 2
    >> B=[1 2 3; 4 5 6]
    B =
    1 2 3
    4 5 6
    >> C=[2 0 0; 0 3 0; 0 0 1]
    C =
    2 0 0
    0 3 0
    0 0 1
    >> A*B
    ans =
    3 6 9
    8 10 12
    >> B*C
    ans =
    2 6 3
    8 15 6

    NAMA : Fajar Nurhfi Ilsan
    NIM : 10.11.4574

  99. Matlab 6.

    >> a=[1 2 3;4 5 6]
    a =
    1 2 3
    4 5 6
    …>> b=[7 8 9;0 1 2]
    b =
    7 8 9
    0 1 2
    >> a+b
    ans =
    8 10 12
    4 6 8
    >> a-b
    ans =
    -6 -6 -6
    4 4 4
    No,2.
    >> a= [1 0 -1]
    a =
    1 0 -1
    >> b= [4;3;2]
    b =
    4
    3
    2
    >> a*b
    ans =
    2
    .3.
    >>A=[1 0;1 1]
    A =
    1 0
    1 1
    >> B=[2 3;4 1]
    B =
    2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C =
    1 1 2
    0 2 3
    >> A*B
    ans =
    2 3
    6 4
    >> B*A
    ans =
    5 3
    5 1
    >> A*C
    ans =
    1 1 2
    1 3 5
    >> B*C
    ans =
    2 8 13 4 6 11
    No.4.
    >> [3 0;0 2]*[1 2 3;4 5 6]
    ans =
    3 6 9
    8 10 12
    >> [1 2 3;4 5 6]*[2 0 0;0 3 0;0 0 1]
    ans =
    2 6 3
    8 15 6

  100. NAMA : JEFFRI ARDIANSYAH
    NIM : 10.11.4570

    No.1.
    >> a=[1 2 3;4 5 6]
    a =
    1 2 3
    4 5 6
    …>> b=[7 8 9;0 1 2]
    b =
    7 8 9
    0 1 2
    >> a+b
    ans =
    8 10 12
    4 6 8
    >> a-b
    ans =
    -6 -6 -6
    4 4 4
    No,2.
    >> a= [1 0 -1]
    a =
    1 0 -1
    >> b= [4;3;2]
    b =
    4
    3
    2
    >> a*b
    ans =
    2
    .3.
    >>A=[1 0;1 1]
    A =
    1 0
    1 1
    >> B=[2 3;4 1]
    B =
    2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C =
    1 1 2
    0 2 3
    >> A*B
    ans =
    2 3
    6 4
    >> B*A
    ans =
    5 3
    5 1
    >> A*C
    ans =
    1 1 2
    1 3 5
    >> B*C
    ans =
    2 8 13 4 6 11
    No.4.
    >> [3 0;0 2]*[1 2 3;4 5 6]
    ans =
    3 6 9
    8 10 12
    >> [1 2 3;4 5 6]*[2 0 0;0 3 0;0 0 1]
    ans =
    2 6 3
    8 15 6

  101. >> a=[1 2 3;4 5 6]
    a =
    1 2 3
    4 5 6
    …>> b=[7 8 9;0 1 2]
    b =
    7 8 9
    0 1 2
    >> a+b
    ans =
    8 10 12
    4 6 8
    >> a-b
    ans =
    -6 -6 -6
    4 4 4
    No,2.
    >> a= [1 0 -1]
    a =
    1 0 -1
    >> b= [4;3;2]
    b =
    4
    3
    2
    >> a*b
    ans =
    2
    .3.
    >>A=[1 0;1 1]
    A =
    1 0
    1 1
    >> B=[2 3;4 1]
    B =
    2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C =
    1 1 2
    0 2 3
    >> A*B
    ans =
    2 3
    6 4
    >> B*A
    ans =
    5 3
    5 1
    >> A*C
    ans =
    1 1 2
    1 3 5
    >> B*C
    ans =
    2 8 13 4 6 11
    No.4.
    >> [3 0;0 2]*[1 2 3;4 5 6]
    ans =
    3 6 9
    8 10 12
    >> [1 2 3;4 5 6]*[2 0 0;0 3 0;0 0 1]
    ans =
    2 6 3
    8 15 6

  102. Nama : DANI ISMAIL
    NIM : 10.11.4578
    Kelas: S1-TI 1N

    1)
    >> A = [1 2 3 ; 4 5 6]

    A =

    1 2 3
    4 5 6

    >> B = [ 7 8 9 ; 0 1 2]

    B =

    7 8 9
    0 1 2

    >> [A+B]

    ans =

    8 10 12
    4 6 8

    >> [A-B]

    ans =

    -6 -6 -6
    4 4 4

    2)
    >> A= [ 1,0,-1]

    A =

    1 0 -1

    >> B = [ 4, 3, 2]

    B =

    4 3 2

    >> A(1)*B(1)+A(2)*B(2)+A(3)*B(3)

    ans =

    2

    3)
    >> A=[1 0; 1 1]

    A =

    1 0
    1 1

    >> B= [2 3 ;4 1]

    B =

    2 3
    4 1

    >> C= [1 1 2; 0 2 3]

    C =

    1 1 2
    0 2 3

    >> [A*B]

    ans =

    2 3
    6 4

    >> [B*A]

    ans =

    5 3
    5 1

    4)
    >> [[ 3 0 ; 0 2]*[1 2 3; 4 5 6]]

    ans =

    3 6 9
    8 10 12

    >> [[1 2 3; 4 5 6]*[2 0 0; 0 3 0; 0 0 1]]

    ans =

    2 6 3
    8 15 6

  103. 1.
    >> A=[1 2 3 ; 4 5 6]

    A =

    1 2 3
    4 5 6

    >> B=[7 8 9 ; 0 1 2]

    B =

    7 8 9
    0 1 2

    >> A+B

    ans =

    8 10 12
    4 6 8

    >> A-B

    ans =

    -6 -6 -6
    4 4 4

    2.

    >> A=[1 0 1]

    1 0 -1

    >> B=[4; 3; 2]

    B =

    4
    3
    2

    >> A*B

    ans =

    2

    3.

    >> A=[1 0; 1 1]

    A =

    1 0
    1 1

    >> B=[2 3; 4 1]

    B =

    2 3
    4 1

    >> C=[1 1 2; 0 2 3]

    C =

    1 1 2
    0 2 3
    >> A*B

    ans =

    2 3
    6 4

    >> B*A

    ans =

    5 3
    5 1

    >> A*C

    ans =

    1 1 2
    1 3 5

    >> C*A
    ??? Error using ==> mtimes
    Inner matrix dimensions must agree.

    4.

    A =

    3 0
    0 2

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

    B =

    1 2 3
    4 5 6

    >> C=[2 0 0; 0 3 0; 0 0 1]

    C =

    2 0 0
    0 3 0
    0 0 1

    >> A*B

    ans =

    3 6 9
    8 10 12

    >> B*C

    ans =

    2 6 3
    8 15 6

  104. Willy Brillian Einstein El Habib Taufik
    10.11.4558
    1) >> A=[1 2 3;4 5 6]
    A =
    1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B =
    7 8 9
    0 1 2
    >> A+B
    ans =
    8 10 12
    4 6 8
    >> A-B
    ans =
    -6 -6 -6
    4 4 4
    2) >> a=[1 0 -1]
    a =
    1 0 -1
    >> b=[4 ; 3; 2]
    b =
    4
    3
    2
    >> a*b
    ans =
    2
    3) >> A=[1 0;1 1]
    A =
    1 0
    1 1
    >> B=[2 3;4 1]
    B =
    2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C =
    1 1 2
    0 2 3
    >> A*B
    ans =
    2 3
    6 4
    >> B*A
    ans =
    5 3
    5 1
    >> A*C (DEFINED)
    ans =
    1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    5) >> A=[3 0;0 2]
    A =
    3 0
    0 2
    >> B=[1 2 3;4 5 6]
    B =
    1 2 3
    4 5 6
    >> A*B
    ans =
    3 6 9
    8 10 12
    >> C=[1 2 3;4 5 6]
    C =
    1 2 3
    4 5 6
    >> D=[2 0 0;0 3 0;0 0 1]
    D =
    2 0 0
    0 3 0
    0 0 1
    >> C*D
    ans =
    2 6 3
    8 15 6

  105. ARDYAN NUR ISMAYADI
    10.11.4606
    1) >> A=[1 2 3;4 5 6]
    A =
    1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B =
    7 8 9
    0 1 2
    >> A+B
    ans =
    8 10 12
    4 6 8
    >> A-B
    ans =
    -6 -6 -6
    4 4 4
    2) >> a=[1 0 -1]
    a =
    1 0 -1
    >> b=[4 ; 3; 2]
    b =
    4
    3
    2
    >> a*b
    ans =
    2
    3) >> A=[1 0;1 1]
    A =
    1 0
    1 1
    >> B=[2 3;4 1]
    B =
    2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C =
    1 1 2
    0 2 3
    >> A*B
    ans =
    2 3
    6 4
    >> B*A
    ans =
    5 3
    5 1
    >> A*C (DEFINED)
    ans =
    1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.
    5) >> A=[3 0;0 2]
    A =
    3 0
    0 2
    >> B=[1 2 3;4 5 6]
    B =
    1 2 3
    4 5 6
    >> A*B
    ans =
    3 6 9
    8 10 12
    >> C=[1 2 3;4 5 6]
    C =
    1 2 3
    4 5 6
    >> D=[2 0 0;0 3 0;0 0 1]
    D =
    2 0 0
    0 3 0
    0 0 1
    >> C*D
    ans =
    2 6 3
    8 15 6

  106. Doharma Hutagalung
    10.11.4560
    S1 TI-1N

    1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2

    3) >> A=[1 0;1 1]

    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A = 3 0
    0 2

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

    >> A*B
    ans = 3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans = 2 6 3
    8 15 6

  107. Fendy Sapto Purwoko
    10.11.4580
    S1 TI-1N

    1) >> A=[1 2 3;4 5 6]
    A = 1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B = 7 8 9
    0 1 2
    >> A+B
    ans = 8 10 12
    4 6 8
    >> A-B
    ans = -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a = 1 0 -1
    >> b=[4 ; 3; 2]
    b = 4
    3
    2
    >> a*b
    ans = 2

    3) >> A=[1 0;1 1]

    A = 1 0
    1 1
    >> B=[2 3;4 1]
    B = 2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C = 1 1 2
    0 2 3
    >> A*B
    ans = 2 3
    6 4
    >> B*A
    ans = 5 3
    5 1
    >> A*C (DEFINED)
    ans = 1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A = 3 0
    0 2

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

    >> A*B
    ans = 3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C = 1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D = 2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans = 2 6 3
    8 15 6

  108. No.1
    >> A = [1,2,3;4,5,6]

    A =

    1 2 3
    4 5 6

    >> B = [7,8,9;0,1,2]

    B =

    7 8 9
    0 1 2

    >> A+B

    ans =

    8 10 12
    4 6 8

    >> A-B

    ans =

    -6 -6 -6
    4 4 4

    No.2
    >> a=[1,0,-1]

    a =

    1 0 -1

    >> b=[4;3;2]

    b =

    4
    3
    2

    >> a*b

    ans =

    2

    No.3
    >> A = [1,0;1,1]

    A =

    1 0
    1 1

    >> B = [2,3;4,1]

    B =

    2 3
    4 1

    >> C = [1,1,2;0,2,3]

    C =

    1 1 2
    0 2 3

    >> A*B

    ans =

    2 3
    6 4

    >> B*A

    ans =

    5 3
    5 1

    >> A*C

    ans =

    1 1 2
    1 3 5

    >> C*A
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    No.4
    Tidak ada di File Download

    No.5
    >> A=[3,0;0,2]

    A =

    3 0
    0 2

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

    B =

    1 2 3
    4 5 6

    >> A*B

    ans =

    3 6 9
    8 10 12

    >> C=[2,0,0;0,3,0;0,0,1]

    C =

    2 0 0
    0 3 0
    0 0 1

    >> B*C

    ans =

    2 6 3
    8 15 6

  109. Happy Alfi Azizah
    10.11.4585

    1) >> A=[1 2 3;4 5 6]
    A =
    1 2 3
    4 5 6
    >> B=[7 8 9;0 1 2]
    B =
    7 8 9
    0 1 2
    >> A+B
    ans =
    8 10 12
    4 6 8
    >> A-B
    ans =
    -6 -6 -6
    4 4 4

    2) >> a=[1 0 -1]
    a =
    1 0 -1
    >> b=[4 ; 3; 2]
    b =
    4
    3
    2
    >> a*b
    ans =
    2

    3) >> A=[1 0;1 1]

    A =
    1 0
    1 1
    >> B=[2 3;4 1]
    B =
    2 3
    4 1
    >> C=[1 1 2;0 2 3]
    C =
    1 1 2
    0 2 3
    >> A*B
    ans =
    2 3
    6 4
    >> B*A
    ans =
    5 3
    5 1
    >> A*C (DEFINED)
    ans =
    1 1 2
    1 3 5
    >> C*A (NOT DEFINED)
    ??? Error using ==> *
    Inner matrix dimensions must agree.

    5) >> A=[3 0;0 2]
    A =
    3 0
    0 2

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

    >> A*B
    ans =
    3 6 9
    8 10 12

    >> C=[1 2 3;4 5 6]
    C =
    1 2 3
    4 5 6

    >> D=[2 0 0;0 3 0;0 0 1]
    D =
    2 0 0
    0 3 0
    0 0 1

    >> C*D

    ans =
    2 6 3
    8 15 6

  110. 1) >> a= [1 2 3;4 5 6]
    a =
    1 2 3
    4 5 6
    >> b=[7 8 9;0 1 2]
    b =
    7 8 9
    0 1 2

    >> a+b
    ans =
    8 10 12
    4 6 8

    >> a-b
    ans =
    -6 -6 -6
    4 4 4

    2) >> a= [1 0 -1]
    a =
    1 0 -1

    >> b= [4;3;2]
    b =
    4
    3
    2
    >> a*b

    ans =
    2

    3) >>A=[1 0;1 1]
    A =
    1 0
    1 1

    >> B=[2 3;4 1]
    B =
    2 3
    4 1

    >> C=[1 1 2;0 2 3]

    C =
    1 1 2
    0 2 3

    >> A*B
    ans =
    2 3
    6 4

    >> B*A
    ans =
    5 3
    5 1

    >> A*C
    ans =
    1 1 2
    1 3 5

    >> B*C

    ans =
    2 8 13 4 6 11

    4) >> [3 0;0 2]*[1 2 3;4 5 6]
    ans =
    3 6 9
    8 10 12

    >> [1 2 3;4 5 6]*[2 0 0;0 3 0;0 0 1]
    ans =
    2 6 3
    8 15 6

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s