Documentation

SimulinkRealTime.utils.minimumSampleTime

Determine the minimum sample time at which a model can run

Syntax

minTs = SimulinkRealTime.utils.minimumSampleTime(model_name)
minTs = SimulinkRealTime.utils.minimumSampleTime(model_name, '-cleanup')

Description

example

minTs = SimulinkRealTime.utils.minimumSampleTime(model_name) executes the model in real time on a target computer and returns the minimum sample time at which it can run.

The target computer must be running and connected to the development computer. The function builds the model and downloads it automatically to the target computer.

example

minTs = SimulinkRealTime.utils.minimumSampleTime(model_name, '-cleanup') executes the model in real time on a target computer and returns the minimum sample time at which it can run.

The target computer must be running and connected to the development computer. The function builds the model and downloads it automatically to the target computer. When execution is complete, the function deletes the build files.

Examples

collapse all

Determines the minimum sample time of model xpcosc.

minTs = SimulinkRealTime.utils.minimumSampleTime('xpcosc')
minTs =

   8.4727e-06

To avoid CPU overruns, set your model sample time to a value slightly above the lower limit, for example to 10e-6.

Determines the minimum sample time of model xpcosc, and then cleans up the build folder.

minTs = SimulinkRealTime.utils.minimumSampleTime('xpcosc', ...
        '-cleanup')
minTs =

   8.4727e-06

To avoid CPU overruns, set your model sample time to a value slightly above the lower limit, for example to 10e-6.

Input Arguments

collapse all

Enclose the model name character vector in single quotation marks.

Example: 'xpcosc'

Data Types: char

Output Arguments

collapse all

The minimum sample time at which the function executed the model. To avoid the overloads that random variations can cause, set your model sample time to a value slightly above the minimum sample time.

Introduced in R2016a

Was this topic helpful?