diff --git a/varargin2struct.m b/varargin2struct.m index 52340ba..d19f0a9 100644 --- a/varargin2struct.m +++ b/varargin2struct.m @@ -31,7 +31,7 @@ while (i <= len) if (isstruct(varargin{i})) opt = mergestruct(opt, varargin{i}); - elseif (ischar(varargin{i}) && i < len) + elseif ((ischar(varargin{i}) || isa(varargin{i}, 'string')) && i < len) opt.(lower(varargin{i})) = varargin{i + 1}; i = i + 1; else