Benutzerdefinierte Objektanzeige für Klassen
Anpassen, wie MATLAB® Objekte Ihrer Klasse im Befehlsfenster anzeigt
Die CustomDisplay
-Klasse definiert eine Schnittstelle, über die Sie anpassen können, wie MATLAB Objekte anzeigt. Einen Überblick zur Schnittstelle finden Sie unter Custom Display Interface. Zudem ermöglicht es Ihnen die CustomCompactDisplayProvider
-Klasse, die Anzeige von Objekten in Containers wie Strukturen und Tabellen anzupassen. Einen Überblick zur Schnittstelle finden Sie unter Custom Compact Display Interface.
Funktionen
details | Display array details |
Klassen
matlab.mixin.CustomDisplay | Interface for customizing object display |
matlab.mixin.util.PropertyGroup | Custom property list for object display |
matlab.mixin.CustomCompactDisplayProvider | Interface for customizing object display within containers (Seit R2021b) |
matlab.display.CompactDisplayRepresentation | Base class for representing compact display of object array (Seit R2021b) |
matlab.display.DisplayConfiguration | Describe display environment and settings (Seit R2021b) |
matlab.display.DimensionsAndClassNameRepresentation | Compact display representation using dimensions and class name (Seit R2021b) |
matlab.display.PlainTextRepresentation | Compact display representation using data in object array (Seit R2021b) |
Themen
Benutzerdefinierte Anzeigeschnittstelle – Klasse und Methoden
- Custom Display Interface
TheCustomDisplay
class provides an API for customizing the display of objects of your class. - How CustomDisplay Works
MATLAB determines the state of an object and then calls specific methods for that state to display the object. - Class with Default Object Display
This example class customizes various aspects of object display. - Role of size Function in Custom Displays
MATLAB uses the size function to help determine the state of the object to display.
Spezifische Techniken für die Anpassung der Objektanzeige
- Choose a Technique for Display Customization
You can customize object display based on the state of the object and you can change different parts of the display. - Customize Property Display
Change the order and number of properties displayed for an object of your class. - Customize Header, Property List, and Footer
Customize each of the three parts of the display — header, property groups, and footer. - Customize Display of Scalar Objects
Customize the display of scalar objects. - Customize Display of Object Arrays
Customize the display of nonscalar objects, including empty object arrays. - Customize Display for Heterogeneous Arrays
You can call only sealed methods on nonscalar heterogeneous arrays. - Overloading the disp Function
Overloading thedisp
function provides limited display customization.
Benutzerdefinierte Kompaktdisplays
- Custom Compact Display Interface
Customize the representation of objects in compact display scenarios.