Matlab Arrays
Array Basics
An array is an n-dimensional collection of numbers. Matrices are 2-dimensional arrays, and vectors are 1-dimensional arrays.
Vectors can be either a row or column vector:
We refer to the elements of an array by their position in the array. For example, the third element in is 3.2, and the second element in is .
Matrices are two-dimensional arrays, whose elements are referred to by the row and column that they belong to. For example,
is a matrix with three rows and two columns. We refer to this as a Failed to parse (syntax error): \\scriptstyls 3 \times 2 matrix. The first index is the row and the second index is the column.
Transposing Arrays
Occasionally we want to transpose an array. This is done by exchanging rows and columns. For example,
Here the superscript indicates transpose. Note that if we transpose an array twice, we recover the original array. In other words, .