syms x - Not enough input arguments.

3 views (last 30 days)
>> syms x
Not enough input arguments.
Error in digits (line 3)
for i=1:length(s)
Error in sym (line 192)
S.Digits = digits;
Error in syms (line 227)
defined = sym(zeros(1, length(args)));
>> ver
MATLAB Version 9.8 (R2020a)
Simulink Version 10.1 (R2020a)
Symbolic Math Toolbox Version 8.5 (R2020a)
>> which syms
C:\Program Files\Polyspace\R2020a\toolbox\symbolic\symbolic\syms.m
Comment: It looks like matlab can find and call the function. Any explaination or suggestion regarding the error is greatly appreciated.

Accepted Answer

Cris LaPierre
Cris LaPierre on 27 Jan 2021
Is it possible you have overwritten the digits function?
>> which digits
C:\Program Files\MATLAB\R2020a\toolbox\symbolic\symbolic\digits.m
My R2020a file does not contain a line "for i=1:length(s)" anywhere in it. Your error message suggests it is line 3.
When I create a local digits function (saved in the current folder), I get the following error message.
Not enough input arguments.
Error in digits (line 3)
for i=1:length(s)
Error in sym (line 201)
S.Digits = digits;
Error in sympref>implementedSymprefs (line 154)
y = {'FourierParameters', sym([1,-1]), 'MuPAD', 'sym', {};...
Error in sympref (line 90)
iSymprefs = implementedSymprefs;
Error in symengine
Error in sym (line 200)
symengine;
Error in syms (line 227)
defined = sym(zeros(1, length(args)));
Warning: Failed to initialize symbolic preferences.
> In symengine
In sym (line 200)
In syms (line 227)
Not enough input arguments.
Error in digits (line 3)
for i=1:length(s)
Error in sym (line 201)
S.Digits = digits;
Error in syms (line 227)
defined = sym(zeros(1, length(args)));
  3 Comments
Steven Lord
Steven Lord on 27 Jan 2021
I agree this is the likely cause. Line 3 of the digits.m included in Symbolic Math Toolbox is part of the function help text, not executable code. Rename your digits.m file (not the one in Symbolic Math Toolbox.)
Jiawei Gong
Jiawei Gong on 27 Jan 2021
Edited: Jiawei Gong on 27 Jan 2021
Thank you very much, gentlemen. The issue was exactly the overriding built-in with my own. Appreciate the swift answers.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!