Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Simulink.BlockDiagram.getSampleTimes - Return all sample times associated with a model

Syntax

ts = Simulink.BlockDiagram.getSampleTimes(mdl)

Arguments

mdl

Name or handle of a Simulink model

Returns

ts

The command returns ts which is a 1xn array of Simulink.SampleTime objects associated with the model passed to Simulink.BlockDiagram.getSampleTimes. Here n is the number of sample times associated with the block diagram. The format of the returns is as follows:

1xn Simulink.SampleTime
Package: Simulink

value: [1x2 double] Description: [char string] ColorRGBValue: [1x3 double] Annotation: [char string] OwnerBlock: [char string] ComponentSampleTimes: [1x2 struct]
Methods

Description

ts = Simulink.BlockDiagram.getSampleTimes(mdl) performs an update diagram and then returns the sample times associated with the block diagram specified by the input argument mdl. The update diagram ensures that the sample time information returned is up-to-date. If the model is already in the compiled state via a call to the model API, then an update diagram is not necessary.

Using this method allows you to access all information in the Sample Time Legend programmatically.

See Also

Simulink.Block.getSampleTimes

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS