Select a System Object Template
System objects are used to define the behavior of device driver blocks. Follow these steps to create your own System object™ by modifying the template System object.
In the MATLAB®Editor, open the template system object class file,
Sink.m
.Save a copy of the class file and rename it
DigitalWrite.m
.Open
DigitalWrite.m
and change the class name toDigitalWrite
.classdefDigitalWrite < matlab.System ... & coder.ExternalDependency ... & matlab.system.mixin.Propagates ... & matlab.system.mixin.CustomIcon ...end
Change the name of the constructor method to
DigitalWrite
.methods% Constructorfunctionobj = DigitalWrite(varargin)% Support name-value pair arguments when constructing the object.setProperties(obj,nargin,varargin{:});endend
Note
A MATLAB class requires the class name, constructor, and file to be identical.
Save the changes to
DigitalWrite.m
.
In the next section, you willSpecify the Initialization, Output, and Termination Behaviorof the System object.
See Also
Create a Digital Read Block|Write the Hardware-Specific C/C++ Code|Specify the Initialization, Output, and Termination Behavior