MATLAB: Strange ML errors for simple scripts

deprecated functionwarning not error

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

Best Answer

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.