table

Methods

Method Reference: table.isvector

table: TF = isvector (tbl)

Test input table for being a vector.

TF = isvector (tbl) returns true if the input table tbl has a single row or a single column.

Source Code: table

Example: 1

A table is a vector when it is a single row or a single variable — the table analogue of a 1-by-N or N-by-1 array.

One variable, several rows: a column, hence a vector.

 isvector (table ([1; 2; 3]))
ans = 1

One row, several variables: a row, hence a vector.

 isvector (table (1, 2, 3))
ans = 1

Multiple rows and multiple variables: not a vector.

 isvector (table ([1; 2], [3; 4]))
ans = 0