What causes variable editor to be blank for OOP (openvar)

6 次查看(过去 30 天)
Hi,
I've got some fairly large OOP classes defined (which are subclasses of another). Sometime recently, I must have changed something, because now the variable editor/viewer ('openvar') shows blank when I try to open an object of one of these classes (even if I return just the default state of the object. i.e. X = myObj();)
What are the conditions that can cause this? I'm not getting any errors in the constructors, so I don't know where to start looking.
Thanks, Dan
Please does anybody know anything about this? I don't have any idea how to find the part of the code that is responsible. Thanks. Dan
  2 个评论
per isakson
per isakson 2012-11-6
Just typing "X" at the command prompt, does that show any property values?
>> X
X =
class_handle handle
Properties:
a: 0
b: 0
Dan K
Dan K 2012-11-7
To answer your question: The class has an overloaded disp method, and it correctly presents that output. properties(X) gives a correct list of the properties. When I include the following lines at the beginning of the overloaded disp:
builtin('disp',obj);
return
It does provide a correct listing in the format that you specify.
V/r,
Dan

请先登录,再进行评论。

采纳的回答

Dan K
Dan K 2013-2-6
Update for anybody who may care... I opened a support case to get some help from TMW on this... While waiting I discovered that the culprit was a faulty line of code in a get method for a dependent variable. I don't know that this is the only possible cause of this symptom, but hopefully it gives somebody else a place to start looking.
Dan

更多回答(1 个)

Daniel Shub
Daniel Shub 2012-11-7
This has come up a number of times on Answers. I am pretty sure the variable editor cannot handle custom classes. I would start with this question to see the history. Yair has "customizing the Variable (Array) Editor" on his blog's todo list. My guess is it involves a lot of undocumented java. A donation to his blog might move it up the list....
  1 个评论
Dan K
Dan K 2012-11-7
Daniel,
Thank you for the response. I can vouch that the variable editor can handle custom classes as a closely related class which I've constructed shows up just fine. What I find particularly perplexing is that it isn't showing null properties, but isn't even listing the properties.
V/r, Dan

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Call Java from MATLAB 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by