error with 'syms'
이전 댓글 표시
Hello
I have a problem with use 'syms' function
I want to execute the code below
-----------------------------
syms x y
f=x^2+y
__________________
but the error message 'Execute script syms as a function is not supported'
I have installed the symbolic toolbox. How can i execute the code??
thanks a lot
댓글 수: 12
What does this show?
which syms
Jihun Gil
2022년 2월 3일
Jihun Gil
2022년 2월 3일
KSSV
2022년 2월 3일
In the path: @sym this might be creating a problem.... How did you install tool box?
Jihun Gil
2022년 2월 3일
KSSV
2022년 2월 3일
I have no idea...I think the problem is with the path due @, but I am not sure. Let's see some one can answer the real solution.
Jihun Gil
2022년 2월 3일
KSSV
2022년 2월 3일
Huumh....thats the real problem. Good problem is solved.
Jihun Gil
2022년 2월 3일
"I think the problem is with the path due @"
In fact the @ in the folder path simply tells us that the folder defines a class:
The actual problem was that the OP shadowed SYMS here:
and confirmed here:
답변 (1개)
Shubham
2024년 8월 21일
Hi Jihun,
The error message you're seeing, "Execute script syms as a function is not supported," typically occurs when there is a conflict with the syms function. This usually happens if there is a script or a file named syms.m in your current directory or MATLAB path that is shadowing the built-in syms function from the Symbolic Math Toolbox.
Here are steps you can take to resolve this issue:
Steps to Resolve the Issue
- Check for Conflicting Files:
- Use the which command to check if there is a conflicting file named syms.m in your path:
which syms -all
- This command will list all instances of syms that MATLAB can find. Ensure that the first entry in the list is the built-in function from the Symbolic Math Toolbox.
2. Remove or Rename Conflicting Files:
- If you find a syms.m file in your current directory or elsewhere in your MATLAB path that is not part of the Symbolic Math Toolbox, consider renaming or removing it to prevent conflicts.
3. Clear the Path Cache:
- After removing or renaming any conflicting files, clear the path cache to refresh MATLAB's function path:
rehash toolboxcache
카테고리
도움말 센터 및 File Exchange에서 Code Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!