p.addParamValue('string', 'New String', @ischar);
p.addParamValue('enable', true, @islogical);
p.addParamValue('fontsize', 10, @isnumeric);
p.parse(varargin{:});
obj.string = p.Results.string;
obj.enable = p.Results.enable;
obj.fontsize = p.Results.fontsize;
end
end
end
This works: obj1 = classA('string', 'hai')
but I wiould like to also use: obj2 = classA('str', 'hai') or obj3 =
classA('stri', 'hai')
i.e using short form of parser parameters I want to run my class.
Using 'str' or 'stri' or 'strin' etc must work as similar to using
'string' in the arguments. Can any one suggest me on this??
(like uicontrol('str', 'hello', 'pos', [10 10 50 20]))
thanks in advance!!