Vector and matrix element access
Jump to navigation
Jump to search
Elements of vectors and matrices can be accessed in two ways: With the mindex function and with angular brackets [ ].
[ expression ]accesses an element of a vector. Indexes start at 1.[ expression , expression ]accesses an element of a matrix. Indexes start at 1, and the first index is the row number. Either of the expressions can be replaced by an asterisk*, then the whole row or column will be returned as a vector.