Illustration of symbolic variable:
When, on the other hand, z is a symbolic variable to start with, quotes are not required around the expression, and the words are automatically collected:
>> z = sym('z');
>> sym(z^3 + 2*z^3)
ans =
3*z^3
When you want to use the multiple variables as symbolic variable names, the syms function is a shortcut rather than of using sym repetitively. The illustration is as follows,
>> syms x y z
does similar thing as
>> x = sym('x');
>> y = sym('y');
>> z = sym('z');