Why do I receive a CODEGEN error when using "C" as a variable name in the Symbolic Math Toolbox 2.1.3 (R13)?

1 view (last 30 days)
If I am using only the Symbolic Math Toolbox, I am not able to use "C" as a variable name.
The following steps are performed in the Student Version of R13:
syms C x w
w = C*x
w =
codegen:-C*x
syms D
subs(w,1,2)
ans =
codegen:-C^2*x^2
syms c
w = c*x
w =
c*x

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This issue has been fixed in the Symbolic Math Toolbox 3.1.5 (R2006b). If you are using a previous version, read the following:
As a workaround, avoid using "C" as a variable name.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!