# Check whether the argument of a function is a matrix with numerical values

I know that

MatrixQ[expr,NumericQ]


tells whether expr is a matrix with numerical values or not.

How do I implement such a check for an argument of a function?

func[matr_?WhatShouldIWriteHere]:=Module[{},...];


(should only work if matr is a matrix with numerical values)

• Any predicate is ok: just write MatrixQ[#,NumericQ]&. (Although you might prefer NumberQ.) – Alan Sep 20 '19 at 21:54
• In addition to @Alan's comment, use parentheses, e.g., func[matr_?(MatrixQ[#, NumericQ]&)] := .. – Carl Woll Sep 20 '19 at 22:22