DataStore function returns an error

조회 수: 6 (최근 30일)
Mehdi Shafiei
Mehdi Shafiei 2020년 4월 5일
댓글: per isakson 2020년 4월 8일
DataStore function returns an error which it shouldn't.
The version of MAtlab is 2018b
Error in line 169 too many input arguments
No problem of my number of the input arguments even the Matlab example does not work.
Line 169 in DataStore.m :
% call the constructor
ds = feval(dsName, location, varargin{:});
  댓글 수: 9
Mehdi Shafiei
Mehdi Shafiei 2020년 4월 6일
@per! do you have the same problem or it is running through?
@Image very strange! I don'rt know what it means. I am sure that I use 2018b I tried on a 2018a on another machine and it works.
It is a very strange problem and I have not modified any function that is in use.
The same functions the same m files and the problem is there for one.
per isakson
per isakson 2020년 4월 6일
No problem, see my answer.

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

답변 (2개)

Walter Roberson
Walter Roberson 2020년 4월 5일
Notice from the header that this is R2018b.
Notice from the output that R2018b does not have a problem with that command.
  댓글 수: 2
Mehdi Shafiei
Mehdi Shafiei 2020년 4월 5일
It clears up that there shouldn't be a problem with the version.
Good! and thanks!
But where is the problem then?
Walter Roberson
Walter Roberson 2020년 4월 6일
You have been modifying MATLAB functions. That makes it difficult for us to guess which modification you made might be interfering with the code.

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


per isakson
per isakson 2020년 4월 6일
편집: per isakson 2020년 4월 6일
I use R2018b
>> version
ans =
'9.5.0.944444 (R2018b)'
The example of the help on datastore works as expected in the Live Editor
I cannot guess why it doesn't work on your system.
Proposal:
  • Set a breakpoint at line 169 of datastore()
  • Run datastore
  • At line 169 display the values of the input variables
>> ds = datastore('airlinesmall.csv', 'TreatAsMissing','NA');
169 ds = feval(dsName, location, varargin{:});
K>> dsName, location, varargin{:}
dsName =
'matlab.io.datastore.TabularTextDatastore'
location =
'airlinesmall.csv'
ans =
'TreatAsMissing'
ans =
'NA'
K>>
Do you get a different values compared to mine?
  댓글 수: 12
Mehdi Shafiei
Mehdi Shafiei 2020년 4월 7일
v.v
;)
per isakson
per isakson 2020년 4월 8일
I find it hard to believe that the problem is caused by R2018b proper.
I think the most likely cause is that a function that is called (directly or indirectly) by TabularTextDatastore is shadowed by (has the same name as) a function, which you or someone else has created. Run
dbstop if error
dbstop if caught error
and then
ds = datastore('airlinesmall.csv', 'TreatAsMissing','NA');
The execution may halt at the call of the shadowed function.

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

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by