This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / Tests  /
VectorQ

  • VectorQ[ expr ] gives True if expr is a list, none of whose elements are themselves lists, and gives False otherwise.
  • VectorQ[ expr , test ] gives True only if test yields True when applied to each of the elements in expr.
  • VectorQ[ expr , NumberQ] tests whether expr is a vector of numbers.
  • See the Mathematica book: Section 2.3.5Section 3.7.3.
  • See also: MatrixQ, TensorRank.

    Further Examples

    VectorQ[{a, b, c}] is considered to be a vector as long as none of the entries of the list are lists themselves.

    In[1]:=

    Out[1]=

    In[2]:=

    Out[2]=

    In[3]:=

    Out[3]=

    In[4]:=

    Out[4]=