This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

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, build_mode)

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, build_mode) 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

The model name character vector or string scalar.

Example: 'xpcosc'

Data Types: char | string

The -cleanup argument as character vector or string scalar. If selected, when execution is complete, the function deletes the build files.

Example: '-cleanup'

Data Types: char | string

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