Method on @sym: colon (a, b)
Method on @sym: colon (a, step, b)
Operator on @sym: a:b
Operator on @sym: a:step:b

Generate a range of symbolic expressions.

Examples:

sym(5):10
  ⇒ ans = (sym) [5  6  7  8  9  10]  (1×6 matrix)
0:sym(pi):5*sym(pi)
  ⇒ ans = (sym) [0  π  2⋅π  3⋅π  4⋅π  5⋅π]  (1×6 matrix)
syms x
x:2:(x+6)
  ⇒ ans = (sym) [x  x + 2  x + 4  x + 6]  (1×4 matrix)

The end point b might not be included:

0:sym(pi):10
  ⇒ ans = (sym) [0  π  2⋅π  3⋅π]  (1×4 matrix)

The step can be negative:

sym(6):-3:-3
  ⇒ ans = (sym) [6  3  0  -3]  (1×4 matrix)

See also: @sym/linspace.

Package: symbolic