DataStore function returns an error

2 visualizaciones (últimos 30 días)
Mehdi Shafiei
Mehdi Shafiei el 5 de Abr. de 2020
Comentada: per isakson el 8 de Abr. de 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 comentarios
Mehdi Shafiei
Mehdi Shafiei el 6 de Abr. de 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 el 6 de Abr. de 2020
No problem, see my answer.

Iniciar sesión para comentar.

Respuestas (2)

Walter Roberson
Walter Roberson el 5 de Abr. de 2020
Notice from the header that this is R2018b.
Notice from the output that R2018b does not have a problem with that command.
  2 comentarios
Mehdi Shafiei
Mehdi Shafiei el 5 de Abr. de 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 el 6 de Abr. de 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.

Iniciar sesión para comentar.


per isakson
per isakson el 6 de Abr. de 2020
Editada: per isakson el 6 de Abr. de 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 comentarios
Mehdi Shafiei
Mehdi Shafiei el 7 de Abr. de 2020
v.v
;)
per isakson
per isakson el 8 de Abr. de 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.

Iniciar sesión para comentar.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by