Main Content


Model reference sample time inheritance status for discrete sample times


flag = allowModelReferenceDiscreteSampleTimeInheritanceImpl(obj)


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 block.

Run-Time Details

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.

Input Arguments

expand all

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

expand all

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 InputsDefault 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 from allowModelReferenceDiscreteSampleTimeInheritanceImpl.

One or more inputs

Default: true — If no other Simulink constraint prevents it, model reference sample time inheritance is allowed.


expand all

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;

Version History

Introduced in R2016a