syms error, cannot use syms command

11 views (last 30 days)
Alita
Alita on 9 Apr 2019
Commented: Walter Roberson on 28 Jan 2025
I am having an issue using the syms command:
syms x(t) y(t)
getting the following error:
Error using assignin
Invalid variable name "x(t)" in ASSIGNIN.
Error in syms (line 56)
assignin('caller',varargin{i},sym(varargin{i}));
Error in Untitled (line 1)
syms x(t) y(t)
I am tried the following solution but I can not solve my problem"
which -all syms
C:\Program Files\MATLAB\R2018b\toolbox\maple\syms.m
My Matlab ver: R2018b
On my system Maple 2018 was installed at: C:\Program Files\Maple 2018

Answers (1)

Aniket
Aniket on 28 Jan 2025
Hi @Alita,
I understand that you are facing issues using "syms" function in MATLAB.
The output from "which -all syms" indicate that MATLAB is using "syms" function from Maple Toolbox instead of Symbolic Toolbox. The issue can be resolved by uninstalling Maple and setting the MATLAB Path to Symbolic Math Toolbox. Detailed instructions on how to do so can be found in this MATLAB Central answer:
I hope this helps resolve the issue!
  1 Comment
Walter Roberson
Walter Roberson on 28 Jan 2025
The maple syms command cannot accept variable names.
If I recall correctly, you needed to use
x = sym('x(t)')
but I could be wrong after all this time.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!