Strange ML errors for simple scripts

2 visualizaciones (últimos 30 días)
David Conway
David Conway el 28 de Ag. de 2016
Comentada: Vahab Youssofzadeh el 20 de Abr. de 2017
Hello, I am seeing strange error messages when running simple scripts, such as cleanUp.m: clc; clear all; close all; fclose ('all'); Matlab runs the code but with serious error messages: Warning: NARGCHK will be removed in a future release. Use NARGINCHK or NARGOUTCHK instead. > In narginchk (line 24) In allchild (line 20) In close>safegetchildren In close In cleanUp (line 3) Error using narginchk (line 24) Too many input arguments.
Error in allchild (line 20) narginchk(1,1);
Error in close
Error in close
Error in cleanUp (line 3) close all; This outcome is typical of all my existing ".m" files.
What have I done!?! Thanks, David

Respuesta aceptada

Steven Lord
Steven Lord el 29 de Ag. de 2016
You most likely have written or downloaded a function named narginchk that is shadowing the built-in function of that name, and your version of that function calls nargchk. To check this, use this command:
which -all narginchk
You should see just the built-in function.
  2 comentarios
David Conway
David Conway el 29 de Ag. de 2016
Steven,
That did the trick. I had downloaded a locally developed data viewer that I had not used to date. narginchk was in there. I killed the viewer code, et voila, it is fixed! Thanks!
Vahab Youssofzadeh
Vahab Youssofzadeh el 20 de Abr. de 2017
Worked for me as well. Thanks.

Iniciar sesión para comentar.

Más respuestas (1)

John D'Errico
John D'Errico el 29 de Ag. de 2016
Editada: John D'Errico el 29 de Ag. de 2016
They are not serious error messages. YET. In fact, they are not error messages at all. At some point in time, the code in question will become obsolete, no longer working due to planned language changes.
When it starts with the word "warning", it is a warning, NOT an error.
What have you done? Nothing really, except get code from someone, where the code will be out of date eventually. Nothing lasts forever. You can return to the author, and hope they are willing to fix it. Or you can learn enough to repair this yourself in advance.

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by