Displaying a subclass of timeseries in the Variable Editor
5 views (last 30 days)
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 on 8 Aug 2012
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.