Mathematica 9 is now available
 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]=



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.