"I can make my class inherit from your mentioned parent classes, but i cannot view those classes.. so there is no way of finding out which method to overwrite i guess?"
First, I've never tried to override the display of classes as you want to do, so disclaimer: I've no idea if matlab.mixin.internal.MatrixDisplay allows you to do that or not.
Yes, there is a way of finding out all the methods of the class as well as their signature, attributes and names of inputs and outputs. There is however no way to see their source code so you still have to do a fair amount of reverse engineering.
mc = meta.class.fromName('matlab.mixin.internal.MatrixDisplay')
mc.MethodList is an array of meta.method objects describing all the methods of the class (included private/protected/hidden methods). You can see that there is one abstract method disp (public, hidden) which takes two inputs helpfully named rhs1 and rhs2. You probably also need to override displayImpl (protected, hidden) which also takes two inputs.
Another disclaimer: The above is valid in R2019b. None of these classes are documented so they can change/disappear in the next version. If you have access to the R2020a pre-release, I'd strongly recommend having a look at the parent classes of datetime. Unfortunately, we're not allowed to discuss the pre-release.
7 Comments
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_807403
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_807403
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_807473
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_807473
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_807517
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_807517
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_807525
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_807525
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_812037
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_812037
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_812041
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_812041
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_812400
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/509721-customize-how-my-class-is-displayed-as-a-property-of-any-other-class#comment_812400
Sign in to comment.