DataStore function returns an error

6 次查看(过去 30 天)
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.

请先登录,再进行评论。

回答(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 个评论
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