Restore the possibility of calling the “resid” function without argument

Can be useful when writing “z = resid;” in a .mod file (i.e. not using the
preprocessor syntax).
trustregion
Sébastien Villemot 2022-03-01 16:38:36 +01:00
parent 3d7299c1e4
commit ae1e31b7e0
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 3 additions and 1 deletions

View File

@ -31,7 +31,9 @@ function z = resid(options_resid_)
global M_ options_ oo_
non_zero = isfield(options_resid_, 'non_zero') && options_resid_.non_zero;
% Properly handle the case where no input argument is given, e.g. when
% writing “z = resid;” in a .mod file (hence not using the preprocessor syntax).
non_zero = nargin > 0 && isfield(options_resid_, 'non_zero') && options_resid_.non_zero;
tags = M_.equations_tags;
istag = 0;