Displaying a subclass of timeseries in the Variable Editor

3 次查看(过去 30 天)
Hello,
an object of the Matlab-builtin timeseries-class has a special appearance in the Variable Editor: the time-vector is displayed as vector of datestrings (if the neccessary properties are set correctly...) and the data-vector as-is, which is very useful when Debugging.
I have created a subclass MyTimeseries < timeseries to extend the functionality with some properties and methods. Everything works so far, but an object of this subclass MyTimeseries has not this special appearance in the Variable Editor - it is displayed as an ordinary class or struct variable.
Is there a way of changing this behaviour? So that i can extend the functionality of timeseries and have the nice display in the Variable Editor?
kind regards, Gregor

采纳的回答

Daniel Shub
Daniel Shub 2012-8-8
This question is very similar to this question about using the variable editor with a subclass of the dataset. In my answer I provide a method for forcing what you want by overloading the CLASS method to lie about the class of Mytimeseries. This efficentively fools the variable editor which makes use of proprietary aspects of com.mathworks.mlservices.MLArrayEditorServices. I went on to say in a comment that you do not want to do this since the variable editor is not going to know how to display any new properties that you add to your subclass. This is especially true since getting your class to work with an overloaded CLASS method is going to be a real pain.
I think the best thing to do is contact TMW and ask for a product enhancement that makes variable editor handle user classes better.
  1 个评论
Gregor
Gregor 2012-8-8
Thank you for your fast answer.!
The 'faked' class method in the subclass fools the Variable Editor, but the appearance is only partially correct. And as you said, there will be more problems and so i'm not going to use it. For the time being I use a simple converter method, that creates a copy of my MyTimeseries-object with class-type timeseries. Hoping that this issue is solved soon.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Entering Commands 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by