Method on @sym: isallconstant (x)

Whether all elements of a symbolic array are constant.

Example:

A = [1 2 sym(pi); sym(4) 5 6]
  ⇒ A = (sym 2×3 matrix)
      ⎡1  2  π⎤
      ⎢       ⎥
      ⎣4  5  6⎦

isallconstant (A)
  ⇒ ans = 1

A(1) = sym('x')
  ⇒ A = (sym 2×3 matrix)
      ⎡x  2  π⎤
      ⎢       ⎥
      ⎣4  5  6⎦

isallconstant (A)
  ⇒ ans = 0

See also: @sym/isconstant, @sym/symvar, findsymbols.

Package: symbolic