syms error, cannot use syms command

조회 수: 6 (최근 30일)
Alita
Alita 2019년 4월 9일
댓글: Walter Roberson 2025년 1월 28일
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

답변 (1개)

Aniket
Aniket 2025년 1월 28일
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
Walter Roberson
Walter Roberson 2025년 1월 28일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by