Matlab default arguments
Closed this issue · 1 comments
gchenfc commented
This is the "correct fix" for borglab/gtsam#954. Needed by @mattking-smith
Notice, for example, that in the unit tests, the default argument tests are actually not correct. For example,
wrap/tests/expected/matlab/DefaultFuncInt.m
Lines 1 to 6 in 2489718
This should be something more like
function varargout = DefaultFuncInt(varargin)
if length(varargin) == 2 && isa(varargin{1},'numeric') && isa(varargin{2},'numeric')
functions_wrapper(8, varargin{:});
else if length(varargin) == 1 && isa(...)
...
else if length(varargin) == 0
...
else
error('Arguments do not match any overload of function DefaultFuncInt');
end
varunagrawal commented
Aha you are correct sir. Good call.