Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Cannot edit object properties in variable editor after setting private handle
Replies: 1   Last Post: Jan 31, 2013 5:06 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
S.K.Mody

Posts: 31
Registered: 12/13/04
Cannot edit object properties in variable editor after setting private handle
Posted: Jan 30, 2013 2:05 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

classdef strange

properties (SetAccess = 'private')
hfunc;
end

properties (Access = 'public')
x;
y;
z;
end

methods (Access = 'public')
function s = strange(a, b, c)
s.x = a;
s.y = b;
s.z = c;
end

function s = SetF(s, h)
s.hfunc = h;
end
end

end

s = strange(1,2,3);
--- can edit x, y and z in variable editor.

s = s.SetF(@sin);
---- now cannot edit either x, y or z in variable editor.

s = s.SetF([]);
---- editing re-enabled ----

s = s.SetF(2);
---- no problem---

Why?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.