matlab.System.allowModelReferenceDiscreteSampleTimeInheritanceImpl - Model reference sample time inheritance status for discrete sample
times - MATLAB ([original](https://www.mathworks.com/help/simulink/slref/matlab.system.allowmodelreferencediscretesampletimeinheritanceimpl.html)) ([raw](?raw))
Main Content
Model reference sample time inheritance status for discrete sample times
Syntax
flag = allowModelReferenceDiscreteSampleTimeInheritanceImpl(obj)
Description
[flag](#bu5vhui-1-flag) = allowModelReferenceDiscreteSampleTimeInheritanceImpl([obj](#bu5vhui-1%5Fsep%5Fmw%5F353aa417-3412-46f8-81f1-586adf7da5a8))
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 block.
Run-Time Details
During model compilation, Simulink sets the referenced model sample time inheritance before the System objectsetupImpl method is called.
Method Authoring Tips
You must set Access = protected
for this method.
Input Arguments
System object handle used to access properties, states, and methods specific to the object. If your allowModelReferenceDiscreteSampleTimeInheritanceImpl
method does not use the object, you can replace this input with ~
.
Output Arguments
Flag indicating whether model reference discrete sample time inheritance is allowed for the MATLAB System 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 |
---|---|
No inputs | Default: false — Model reference discrete sample time inheritance is not allowed. If your System object uses discrete sample time in its algorithm, override the default by returning true fromallowModelReferenceDiscreteSampleTimeInheritanceImpl. |
One or more inputs | Default: true — If no other Simulink constraint prevents it, model reference sample time inheritance is allowed. |
Examples
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 tofalse
. Include this code in your class definition file for the object.
methods (Access = protected) function flag = allowModelReferenceDiscreteSampleTimeInheritanceImpl(~) flag = false; end end
Version History
Introduced in R2016a