You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On new versions of matlab, passing varargin as an argument to a function instantiates a "new instance" of varargin...for example
myfunc(varargin)
would create an n x 1 cell array variable named varargin in the local scope of the function, but calling corelib.parseNameValueArguments would create a 1x1 cell array that itself contains the n x 1 varargin cell array. This breaks the function because corelib.parseNameValueArguments throws an error if you provide it one input and it's not a struct. The simple fix is to just rename the variable in the function signature so that matlab doesn't interpret it as another instance of varargin specific to corelib.parseNameValueArguments.
The text was updated successfully, but these errors were encountered:
On new versions of matlab, passing
varargin
as an argument to a function instantiates a "new instance" ofvarargin
...for examplewould create an n x 1 cell array variable named
varargin
in the local scope of the function, but callingcorelib.parseNameValueArguments
would create a 1x1 cell array that itself contains the n x 1varargin
cell array. This breaks the function becausecorelib.parseNameValueArguments
throws an error if you provide it one input and it's not a struct. The simple fix is to just rename the variable in the function signature so that matlab doesn't interpret it as another instance of varargin specific tocorelib.parseNameValueArguments
.The text was updated successfully, but these errors were encountered: