matlab.System Class
Base class for System objects
Description
matlab.System
is the base class for System objects. In
your class definition file, you must subclass your object from this base class (or from
another class that derives from this base class). Subclassing allows you to use the
implementation methods and service methods provided by this base class to build your
object. Type this syntax as the first line of your class definition file to directly
inherit from the matlab.System
base class, where ObjectName
is the name of your
object:
classdef ObjectName < matlab.System
Note
You must set Access = protected
for each matlab.System
method you use in your code.
The matlab.System
class is a handle
class.
Class Attributes
Abstract | true |
HandleCompatible | true |
StrictDefaults | false |
For information on class attributes, see Class Attributes.
Methods
Creation
Description
function obj = ObjectName(varargin)
constructs an
ObjectName
System object™ and sets properties from name-value pair inputs.
The System object constructor is a public method in the class file. The method name matches the class name. When you create a System object, the constructor is called to initialize properties to nondefault values. The constructor returns a new System object.
Inside the constructor, call setProperties
using one of these syntaxes.
setProperties(obj, nargin, varargin{:})
specifies that
properties of the System object are set using Name-Value arguments.
setProperties(obj, nargin, varargin{:}, Prop1, ..., PropN)
specifies that properties of the System object are set using Value-only
arguments
Tip: Within the body of the constructor, do not
assign property values. This practice can cause problems if you use the System object in multiple environments ,such as in a System block, in a
MATLAB script, and in generated code. Instead, use default property values or change
values inside setupImpl
.
Examples
More About
Version History
Introduced in R2011b