Method on @sym: length (x)

Length of a symbolic vector.

Example:

syms x
A = [1 2 x; x 3 4];
length(A)
  ⇒ 3

As usual, be careful with this and matrices: you may want numel instead.

See also: @sym/numel, @sym/size.

Package: symbolic