Documentation

苏bclass Applications

苏bclassing built-in classes and defining interfaces

Derive classes from built-in classes to define specialized data types that extend the operations you can perform on a particular class of data. The subclass inherits the built-in class methods and behaviors and can add new methods to perform specialized operations.

Topics

异构类层次结构

A Class Hierarchy for Heterogeneous Arrays

Heterogeneous class hierarchies enable you to form arrays of different, but related classes.

苏bclasses of Built-In Types

苏bclasses of MATLAB Built-In Types

Extend MATLAB®built-in classes by deriving from these fundamental data types.

Behavior of Inherited Built-In Methods

苏bclass built-in classes to extend the behavior of functions that operate on that type of data.

Use of size and numel with Classes

Thesizeandnumelfunctions work with user-defined class.

Sample Classes Derived from Built-in Classes

苏bclasses of Built-In Types Without Properties

Class can derive from a built-in class without defining properties and new behaviors.

苏bclasses of Built-In Types with Properties

Classes that derive from built-in classes and define properties must define array behaviors for those classes.

Class to Represent Hardware

This example of a class derived from a built-in numeric class inherits useful behaviors.

Enumerations Derived from Built-In Types

Enumeration classes derived from built-in types inherit behaviors from these types

苏perclasses

Abstract Classes

Use abstract classes to define interfaces that each subclass inherits.

Define an Interface Superclass

Ways to define interfaces that sublcasses implement.

Was this topic helpful?