syms error, cannot use syms command

9 vues (au cours des 30 derniers jours)
Alita
Alita le 9 Avr 2019
Commenté : Walter Roberson le 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

Réponses (1)

Aniket
Aniket le 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 commentaire
Walter Roberson
Walter Roberson le 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.

Connectez-vous pour commenter.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by