Encyclosphere.org ENCYCLOREADER
  supported by EncyclosphereKSF

Matracies

From Wikiversity - Reading time: 1 min

This is a matrices tutorial showing a user how to input different matrices, computing different mathematical equations. Some of these equations are matrix multiplication, matrix addition, matrix division, matrix inverses, and determinates.

EDU>> %Matlab EDU>> a = [ 1 2; 3 4 ]

a =

    1     2
    3     4

EDU>> a

a =

    1     2
    3     4

EDU>> a * a

ans =

    7    10
   15    22

EDU>> b = [ 1 2; 0 1 ]

b =

    1     2
    0     1

EDU>> a*b

ans =

    1     4
    3    10

EDU>> b*a

ans =

    7    10
    3     4

EDU>> a + b

ans =

    2     4
    3     5

EDU>> s = a + b

s =

    2     4
    3     5

EDU>> inv (s)

ans =

  -2.5000    2.0000
   1.5000   -1.0000

EDU>> s * inv (s)

ans =

   1.0000   -0.0000
        0    1.0000

EDU>> s/s

ans =

    1     0
    0     1

EDU>> s\s

ans =

    1     0
    0     1

EDU>> inv (s) * s

ans =

   1.0000         0
        0    1.0000

EDU>> a/b

ans =

    1     0
    3    -2

EDU>> a\b

ans =

  -2.0000   -3.0000
   1.5000    2.5000

EDU>> c = [ 1 1; 1 1 ]

c =

    1     1
    1     1

EDU>> inv(c); Warning: Matrix is singular to working precision. EDU>> det(a)

ans =

   -2

EDU>> det(c)

ans =

    0

EDU>> quit


Licensed under CC BY-SA 3.0 | Source: https://en.wikiversity.org/wiki/Matracies
12 views | Status: cached on December 20 2023 11:19:56
↧ Download this article as ZWI file
Encyclosphere.org EncycloReader is supported by the EncyclosphereKSF