isvector
Test whether the input is a vector (one row or one column).
Syntax
Section titled “Syntax”tf = isvector(A)Description
Section titled “Description”Returns true when A has at most one dimension whose size is greater than 1 — that is, when A is 1×N, N×1, or a scalar. A 0×0 empty matrix returns false.
Examples
Section titled “Examples”isvector([1 2 3]) % 1isvector([1;2;3]) % 1isvector(magic(3)) % 0isvector(7) % 1 (scalar is a vector of length 1)