From: us on
"Ahmad" <ahmad.humyn(a)gmail.com> wrote in message <i0at44$mih$1(a)fred.mathworks.com>...
> Yeah I tried subclassing from the handle class, but that has no effect on replaceVals().
>
> I think this wouldn't work:
> obj = new_obj;
> inside the obj's method. Probably I need to set each variable individually. Just that it will be really messy once I have lots of variables.
>
> Thanks again us,

well...
this is how we do it - but it does not seem to be what you want

% file ATEST.M
classdef atest < hgsetget
properties
a;
end
methods
function o=atest(val)
o.a=val;
end
function rval(o,nval)
o.a=nval;
end
end
end

% at the command prompt
r=atest(1);
r.a
% ans = 1
r.rval(inf);
r.a
% ans = inf

us