MATLAB Answers

DataStore function returns an error

8 views (last 30 days)
Mehdi Shafiei
Mehdi Shafiei on 5 Apr 2020
Commented: per isakson on 8 Apr 2020
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 Comments

Show 6 older comments
per isakson
per isakson on 6 Apr 2020
I'm sure I run R2018b and I see the same "Copyright 2012".
Mehdi Shafiei
Mehdi Shafiei on 6 Apr 2020
@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 on 6 Apr 2020
No problem, see my answer.

Sign in to comment.

Answers (2)

Walter Roberson
Walter Roberson on 5 Apr 2020
Notice from the header that this is R2018b.
Notice from the output that R2018b does not have a problem with that command.

  2 Comments

Mehdi Shafiei
Mehdi Shafiei on 5 Apr 2020
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 on 6 Apr 2020
You have been modifying MATLAB functions. That makes it difficult for us to guess which modification you made might be interfering with the code.

Sign in to comment.


per isakson
per isakson on 6 Apr 2020
Edited: per isakson on 6 Apr 2020
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 Comments

Show 9 older comments
per isakson
per isakson on 6 Apr 2020
"[...] I have traced the error and got into the method io.datastore.TabularTextDatastore()." It may well be, but you didn't report what you found.
"nor [...] affets readability" I disagree!
per isakson
per isakson on 8 Apr 2020
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.

Sign in to comment.

Sign in to answer this question.

Products


Release

R2018b