When I use the following code as a script it works without any error.
syms t real
But when I want to use the code inside a function which passes A matrix as an output, and I call the function I get this error:
"w" previously appeared to be
used as a function or command,
conflicting with its use here as
the name of a variable.
A possible cause of this error is
that you forgot to initialize the
variable, or you have initialized
it implicitly using load or eval.