| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
| On this page… |
|---|
The following examples illustrate techniques for defining and accessing data stores. See Ordering Data Store Access for techniques that control data store access over time, such as ensuring that a given data store is always written before it is read. See Using Data Store Diagnostics for techniques you can use to help detect and correct potential data store errors without needing to run any simulations.
The following model illustrates creation and access of a local data store, which is visible only in a model or particular subsystem.

This model uses a data store to permit subsystem A to signal that its output is invalid. If subsystem A's output is invalid, the model uses the output of subsystem B.
The following model replaces the subsystems of the previous example with functionally identical submodels to illustrate use of a global data store to share data in a model reference hierarchy.

In this example, the top model uses a signal object in the MATLAB workspace to define the error data store. This is necessary because data stores are visible across model boundaries only if they are defined by signal objects in the MATLAB workspace.
![]() | Accessing Data Stores with Simulink Blocks | Ordering Data Store Access | ![]() |

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 |