Geoscience Reference
In-Depth Information
B = [4 2 6 5; 7 8 5 6; 2 1 -8 -9; 3 1 2 3];
the matrix multiplication is then
C = A * B'
where ' is the complex conjugate transpose, which turns rows into columns
and columns into rows. h is generates the output
C =
69 103 -79 37
46 94 11 34
53 76 -64 27
44 93 12 24
In linear algebra, matrices are used to keep track of the coei cients of
linear transformations. h e multiplication of two matrices represents the
combination of two linear transformations into a single transformation.
Matrix multiplication is not commutative, i.e., A*B' and B*A' yield
dif erent results in most cases. Similarly, MATLAB allows matrix divisions
representing dif erent transformations, with / as the operator for right-hand
matrix division and \ as the operator for let -hand division. Finally, the
sot ware also allows powers of matrices, ^ .
In earth sciences, however, matrices are ot en simply used as two-
dimensional arrays of numerical data rather than a matrix sensu stricto
representing a linear transformation. Arithmetic operations on such arrays
are carried out element-by-element. While this does not make any dif erence
in addition and subtraction, it does af ect multiplicative operations. MATLAB
uses a dot, . , as part of the notation for these operations.
As an example multiplying A and B element-by-element is performed by
typing
C = A .* B
which generates the output
C =
8 8 18 35
63 24 -5 12
2 3 -24 -45
18 6 6 -6
2.4 Array Manipulation
MATLAB provides a wide range of functions with which to manipulate
arrays (or matrices). h is section introduces the most important functions
Search WWH ::




Custom Search