This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

VectorQ

VectorQ[expr]
gives True if expr is a list or a one-dimensional SparseArray object, none of whose elements are themselves lists, and gives False otherwise.
VectorQ
gives True only if test yields True when applied to each of the elements in expr.
Test whether an object is a vector:
These are not vectors:
Use specific tests to generalize or specialize:
Test whether an object is a vector:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
These are not vectors:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Use specific tests to generalize or specialize:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Test for a vector of integers:
Test for a vector of machine-real numbers:
Test for a vector of real-valued numeric quantities:
Faster test for explicit real-valued numbers:
Define a function that only evaluates for vector arguments:
Numerically find the minimum of the functions with components:
VectorQ is a special case of ArrayQ:
A function equivalent to VectorQ:
New in 1 | Last modified in 5