Last active
December 17, 2015 16:59
Revisions
-
hagenw revised this gist
Dec 2, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ function narginchk(minargs, maxargs) if (nargin ~= 2) error('%s: Usage: narginchk(minargs, maxargs)',upper(mfilename)); elseif (~isnumeric (minargs) || ~isscalar (minargs)) error ('minargs must be a numeric scalar'); elseif (~isnumeric (maxargs) || ~isscalar (maxargs)) error ('maxargs must be a numeric scalar'); elseif (minargs > maxargs) error ('minargs cannot be larger than maxargs') -
hagenw created this gist
May 24, 2013 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ function narginchk(minargs, maxargs) if (nargin != 2) error('%s: Usage: narginchk(minargs, maxargs)',upper(mfilename)); elseif (!isnumeric (minargs) || !isscalar (minargs)) error ('minargs must be a numeric scalar'); elseif (!isnumeric (maxargs) || !isscalar (maxargs)) error ('maxargs must be a numeric scalar'); elseif (minargs > maxargs) error ('minargs cannot be larger than maxargs') end args = evalin ('caller', 'nargin;'); if (args < minargs) error ('not enough input arguments'); elseif (args > maxargs) error ('too many input arguments'); end end