필터 지우기
필터 지우기

syms x - Not enough input arguments.

조회 수: 3 (최근 30일)
Jiawei Gong
Jiawei Gong 2021년 1월 27일
편집: Jiawei Gong 2021년 1월 27일
>> 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.

채택된 답변

Cris LaPierre
Cris LaPierre 2021년 1월 27일
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
Steven Lord
Steven Lord 2021년 1월 27일
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 2021년 1월 27일
편집: Jiawei Gong 2021년 1월 27일
Thank you very much, gentlemen. The issue was exactly the overriding built-in with my own. Appreciate the swift answers.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by