The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

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

"SK " <> wrote in message <kebqt4$9l4$>...
> 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?

Looks like it is a problem with overloading the 'display' method for double. To reproduce the problem, create the class as above and create a folder @double with an overloaded display method. There is an attempt to call 'display' internal to matlab - not sure from which route, but the debugger gets to it at the end of an if - end block. The moment I removed the overloaded method everything was fine.

I had this problem earlier with overloading 'display' for char. I did this in order to have a convenient switch to turn off command line output. Every time I tried to open an m-file via the current folder window, an error would be generated: 'Undefined Command 'display'. ". It turned out there there is a matlab file mopen.m which calls edit(filename) - without a terminating semicolon. This was generating a call to @char\display and for some reason 'display' could not be found. Since 'edit' returned just a boolean value, I simply added the terminating semicolon to edit(filename) and this solved the problem.

I suspect the explanation in the @double case is similar but in this case display seems to be getting called at the end of an if-end block, so I'm not able to spot where the call is coming from. Any experts can comment?

Best Regards.

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.