Graphics Reference
In-Depth Information
Here are some examples:
>> X = [5,4,3]; Y = [1,2,7]; l = X'* Y, m = X * Y ', n = 2 * X, o = X / Y, p = Y\X
l =
5 10 35
4 8 28
3 6 21
m =
34
n =
10 8 6
o =
0.6296
p =
0 0 0
0 0 0
0.7143 0.5714 0.4286
All previous operations are defined in matrix form with the proper dimension. We must not forget that a vector is
a particular case of a matrix, but to operate with it in matrix form (not element by element), it is necessary to respect
the rules of dimensionality for matrix operations. Vector operations x. ' * Y and X.*Y' make no sense, since different
dimensions of vectors are operating. Matrix operations X * Y , 2/X , 2\Y , X ^ 2 , 2 ^ X and X ^ Y make no sense, since
there are errors of dimensionality committed in the arrays.
Here are more examples of matrix operators.
>> M = [1,2,3;1,0,2;7,8,9]
M =
1 2 3
1 0 2
7 8 9
>> B = inv (M), C = M ^ 2, D = M ^(1/2), E = 2 ^ M
B =
-0.8889 0.3333 0.2222
0.2778 - 0.6667 0.0556
0.4444 0.3333 - 0.1111
Search WWH ::




Custom Search