What is the difference between a vector and a matrix in MATLAB?

matlab, matrix, vector

Solution

In MATLAB terminology, both vectors and matrices are arrays of numerical values.

Technically, a vector is a form of a matrix having one row or one column (read about `isvector` and `ismatrix` commands for more information).

Practically, however, matrices are usually referred to in the documentation as having at least 2 columns and 2 rows, so I would rather call `xL` and `xU` vectors.

Problem

I've seen the following statements in a help file: ``` xL = [-6 -6]; xU = [6 6]; ``` I didn't understand whether `xL` and `xU` are vectors or matrices. Thank you.

Original source