Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

What Is Sample Time?

The sample time of a block is a parameter that indicates when, during simulation, the block produces outputs and if appropriate, updates its internal state. The internal state includes but is not limited to continuous and discrete states that are logged.

For many engineering applications, you need to control the rate of block execution. In general, Simulink provides this capability by allowing you to specify an explicit SampleTime parameter in the block dialog or at the command line. Blocks that do not have a SampleTime parameter have an implicit sample time. You cannot specify implicit sample times. Simulink determines them based upon the context of the block in the system. The Integrator block is an example of a block that has an implicit sample time. Simulink automatically sets its sample time to 0.

Sample times can be port-based or block-based. For block-based sample times, all of the inputs and outputs of the block run at the same rate. For port-based sample times, the input and output ports can run at different rates.

Sample times can also be discrete, continuous, fixed in minor step, inherited, constant, variable, triggered, or asynchronous. The following sections discuss these sample time types, as well as sample time propagation and rate transitions between block-based or port-based sample times. You can use this information to control your block execution rates, debug your model, and verify your model.

  


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