
ans =
0.9501 0.6068
0.2311 0.4860
ans =
0 0
Comments:
Examples with matrices build-in functions.
2.1.5 Additional Useful Matrix Functions
Functions that are exhibited in Table 1 can also been applied to a two
dimensional arrays because vectors are special cases of matrices (and vise
versa). Additional build-in functions are illustrated in Table 4.
Basic Information Elementary Matrices and Arrays
n
n
d
d
i
i
m
m
s
s
Number of dimensions
b
b
l
l
k
k
d
d
i
i
a
a
g
g
Block diagonal concatenation
n
n
u
u
m
m
e
e
l
l
Number of elements
Operations and Manipulation
d
d
e
e
t
t
Determinant
r
r
a
a
n
n
k
k
Matrix rank
e
e
x
x
p
p
m
m
Matrix exponential
s
s
o
o
r
r
t
t
r
r
o
o
w
w
s
s
Sort rows in ascending order
f
f
l
l
i
i
p
p
l
l
r
r
Flip matrices left-right
s
s
q
q
r
r
t
t
m
m
Matrix square root
f
f
l
l
i
i
p
p
u
u
d
d
Flip matrices up-down
t
t
r
r
a
a
c
c
e
e
Sum of diagonal elements
i
i
n
n
v
v
Matrix inverse
t
t
r
r
i
i
l
l
Lower triangular part of
matrix
l
l
o
o
g
g
m
m
Matrix logarithm
t
t
r
r
i
i
u
u
Upper triangular part of
matrix
n
n
o
o
r
r
m
m
Matrix or vector norm
Table 4: Various functions that can be used with vectors.
Moreover, type: “
h
h
e
e
l
l
p
p matfun” to view some very useful matrix functions
related with numerical linear algebra.
2.1.6 Example: System of Linear Equations
Many times, a researcher has to solve a system of linear equation
simultaneously. In matrix notation, such problem is formulated as:
bAx
where “A” is a coefficient matrix, “x: is the set (column) of unknowns and “b”
is a column vector. In an equation-wise format, the above is equal to:
Commentaires sur ces manuels