Model reference sample time inheritance status for discrete sample times
flag = allowModelReferenceDiscreteSampleTimeInheritanceImpl(obj)
specifies whether a System object™ in a referenced model is allowed to inherit the sample time of the parent
model. Use this method only for System objects that use discrete sample time and are
intended for inclusion in Simulink® via the MATLAB System (Simulink) block.
flag = allowModelReferenceDiscreteSampleTimeInheritanceImpl(
During model compilation, Simulink sets the referenced model sample time inheritance before the System object
setupImpl method is called.
Method Authoring Tips
You must set
Access = protected for this method.
obj — System object
System object handle used to access properties, states, and methods specific to the object. If
allowModelReferenceDiscreteSampleTimeInheritanceImpl method does not use the object, you can replace this
flag — discrete sample time inheritance flag
Flag indicating whether model reference discrete sample time inheritance is allowed for the MATLAB System (Simulink) block containing the System object, returned as a logical value.
The default value for this argument depends on the number of inputs to the System object. If you want to use the default value, you do not need to include this method in your System object class definition file.
|Number of System object Inputs||Default Value and Override Effects|
System object uses discrete sample time in its algorithm,
override the default by returning
|One or more inputs|
Set Sample Time Inheritance for System Object
For a System object that has one or more inputs, to disallow model reference discrete
sample time inheritance for that object, set the sample time inheritance to
false. Include this code in your class definition file
for the object.
methods (Access = protected) function flag = allowModelReferenceDiscreteSampleTimeInheritanceImpl(~) flag = false; end end
Introduced in R2016a
- Set Model Reference Discrete Sample Time Inheritance (Simulink)
- Model Reference Basics (Simulink)
- Referenced Model Sample Times (Simulink)