WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

NumericArrayQ [expr]

gives True if expr is a valid NumericArray object, and False otherwise.

NumericArrayQ [expr, tpatt]

requires additionally that NumericArrayType [expr] match the pattern tpatt.

NumericArrayQ [expr,tpatt,dpatt]

requires additionally that ArrayDepth [expr] match the pattern dpatt.

Examples  
Basic Examples  
Scope  
Possible Issues  
See Also
Related Guides
History
Cite this Page

NumericArrayQ [expr]

gives True if expr is a valid NumericArray object, and False otherwise.

NumericArrayQ [expr, tpatt]

requires additionally that NumericArrayType [expr] match the pattern tpatt.

NumericArrayQ [expr,tpatt,dpatt]

requires additionally that ArrayDepth [expr] match the pattern dpatt.

Examples

open all close all

Basic Examples  (2)

A valid NumericArray object:

Wolfram Language code: NumericArrayQ[NumericArray[Range[16], "UnsignedInteger8"]]

An expression with head NumericArray that is not a valid byte array object:

Wolfram Language code: NumericArrayQ[NumericArray["abc", "Real32"]]

Scope  (7)

Include a test for the type:

Wolfram Language code: NumericArrayQ[NumericArray[{1., 2.}, "Real64"], "Real64"]

Check to see if the type is a real type:

Wolfram Language code: NumericArrayQ[NumericArray[{1., 2.}, "Real64"], type_ /; StringMatchQ[type, "Real*"]]

Check to see if the type is either a machine integer or real type:

Wolfram Language code: NumericArrayQ[RawArray["Complex64", {{1. + 0.*I, 2. + 0.*I}, {3. + 0.*I, 4. + 0.*I}}], "MachineInteger" | "MachineReal"]

Include a test for the array depth:

Wolfram Language code: NumericArrayQ[NumericArray[{1., 2.}, "Real64"], _, 2]

Allow depth up to 2:

Wolfram Language code: NumericArrayQ[NumericArray[{1., 2.}, "Real64"], _, 1 | 2]

Require depth greater than or equal to 2:

Wolfram Language code: NumericArrayQ[NumericArray[{{1, 2}, {3, 4}}, "Integer8"], _, d_ /; d ≥ 2]

Constrain both the depth and the number type:

Wolfram Language code: NumericArrayQ[RawArray["Complex64", {{1. + 0.*I, 2. + 0.*I}, {3. + 0.*I, 4. + 0.*I}}], type_ /; StringMatchQ[type, "*Integer*"], d_ /; d ≥ 2]

Possible Issues  (1)

The default conversion method will fail when the input array contains numbers that are out of range for the specified type.

Try to store in an "Integer8" numeric array:

Wolfram Language code: NumericArray[{-129}, "Integer8"]

Use the "ClipAndCoerce" method to automatically clip to the smallest "Integer8" :

Wolfram Language code: NumericArray[{-129}, "Integer8", "ClipAndCoerce"]
Wolfram Research (2019), NumericArrayQ, Wolfram Language function, https://reference.wolfram.com/language/ref/NumericArrayQ.html.

Text

Wolfram Research (2019), NumericArrayQ, Wolfram Language function, https://reference.wolfram.com/language/ref/NumericArrayQ.html.

CMS

Wolfram Language. 2019. "NumericArrayQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NumericArrayQ.html.

APA

Wolfram Language. (2019). NumericArrayQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NumericArrayQ.html

BibTeX

@misc{reference.wolfram_2026_numericarrayq, author="Wolfram Research", title="{NumericArrayQ}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/NumericArrayQ.html}", note=[Accessed: 23-August-2026]}

BibLaTeX

@online{reference.wolfram_2026_numericarrayq, organization={Wolfram Research}, title={NumericArrayQ}, year={2019}, url={https://reference.wolfram.com/language/ref/NumericArrayQ.html}, note=[Accessed: 23-August-2026]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /