From: venkat on
I have a class as:
classdef classA
properties
string
enable
fontsize
end
methods
function obj = classA(varargin)
p=inputParser;

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]))
From: venkat on
something like we can use
uicontrol('string', 'hello', 'position', [10 10 50 20], 'units',
'pixels')
or
uicontrol('str', 'hello', 'pos', [10 10 50 20], 'uni', 'pixels')
so in the similar way I want to have the parsing

thanks in advance!!
From: venkat on
something like we can use
uicontrol('string', 'hello', 'position', [10 10 50 20], 'units',
'pixels')
or
uicontrol('str', 'hello', 'pos', [10 10 50 20], 'uni', 'pixels')
so in the similar way I want to have the parsing in the above class

thanks in advance!!