error when use 'x' created by syms method: 输入参数的数目不足。 出错 digits (第 15 行) f = func; 出错 sym/display (第 12 行) if ~isempty(useDigits) && useDigits ~= digits()
6 views (last 30 days)
Show older comments
When enter the code like:
syms x
then:
equ = 2*x==9
It is pop a error:
输入参数的数目不足。(Insufficient number of input parameters)
出错 digits (第 15 行) (error digits (line 15))
f = func;
出错 sym/display (第 12 行) (error sym/display (line 12))
if ~isempty(useDigits) && useDigits ~= digits()
When I write above code with colon (;), there is no error but the result is not what I want to.
In each case it will plot an empty figure for me which is confused. In other machine it will work appropriately, but I failed after update and reinstall my matlab and toolbox and reboot the computer.
4 Comments
Dyuman Joshi
on 29 Dec 2023
Edited: Dyuman Joshi
on 29 Dec 2023
@Boheng Zhao, Run this command and see if the code works afterwords -
restoredefaultpath;
rehash toolboxcache;
Answers (1)
SAI SRUJAN
on 28 Dec 2023
Hi Boheng,
I understand that you are facing an error with the symbolic toolbox.
It looks like you're encountering an issue with MATLAB's symbolic toolbox, specifically when trying to define and display a symbolic equation. The error suggests there might be a problem with your MATLAB installation or with the symbolic toolbox itself, especially since you mention that the code works on another machine.The error messages seem to be pointing to an issue with the 'digits' function, which is related to variable-precision arithmetic and not directly related to defining symbolic variables or equations.
Ensure that there are no user-defined functions or scripts in your MATLAB path that might be overriding the built-in 'digits' or 'display' functions. You can check this by running:
which digits -all
which display -all
It is recommended to update MATLAB to the latest version and restart the software, as this may resolve any potential conflicts or compatibility issues. If the problem persists, reinstalling the Symbolic Math Toolbox might be necessary to ensure all necessary files and dependencies are properly installed.
Please use the following commands to check the proper installation of Symbolic Math Toolbox,
which sym
For a comprehensive understanding of the 'which' command in MATLAB, please refer to the following documentation.
I hope this helps.
0 Comments
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!