syms error, cannot use syms command

6 Ansichten (letzte 30 Tage)
Alita
Alita am 9 Apr. 2019
Kommentiert: Walter Roberson am 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

Antworten (1)

Aniket
Aniket am 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 Kommentar
Walter Roberson
Walter Roberson am 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.

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by