iscolumn

Tests whether the input is a column vector.

Category: Language Fundamentals > Matrices and Arrays

Syntax

tf = iscolumn(A)

True when A is n-by-1 with n of any size, including 0 or 1.

Description

A scalar is a column (and a row). An empty 0-by-1 array is a column, but the plain [] (0 by 0) is not. For a vector in either orientation, see isvector.

Input arguments

A
Any array.

Output arguments

tf
Logical scalar.

Example

iscolumn([1; 2; 3])
iscolumn([1 2 3])
iscolumn(5)
iscolumn([])
Output
ans = logical
   1
ans = logical
   0
ans = logical
   1
ans = logical
   0

See also

isrow isvector isscalar ismatrix