> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/rt-lab/simulink-blocks-reference/rt-lab-library/opdataset.md).

# OpDataSet

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-72d0fcf4d423b740ba96c81979f7f9ab0b78dcac%2FRTL_opdataset_block.png?alt=media" alt=""><figcaption></figcaption></figure>

The **OpDataset** block, located in the **RT-LAB/Data logging** library, reads a cell array from a MATLAB binary file (\*.mat) and outputs the selected column (dataset).

{% hint style="info" %}
Save the variable in MATLAB V6 format (for example: save my\_dataset.mat RPPs -V6).
{% endhint %}

## Mask parameters

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-cea89f01716d07f1ca9713e0fed8bce2d4ef29ef%2FRTL_opdataset_mask.png?alt=media" alt="" width="329"><figcaption></figcaption></figure>

<table><thead><tr><th width="221.00006103515625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Real-Time Path</strong></td><td>Path where the file is located when the simulation runs on the simulator.</td></tr><tr><td><strong>Non Real-Time Path</strong></td><td>Path where the file is located when the model runs on the workstation (Windows).</td></tr><tr><td><strong>Variable Name</strong></td><td>Name of the variable saved in the .mat file. The variable must be saved in MATLAB V6 format. See the example on how to create and save the variable to a .mat file.</td></tr><tr><td><strong>Number of outputs</strong></td><td>Number of outputs, corresponding to the number of columns in the variable.</td></tr><tr><td><strong>Max number of datasets</strong></td><td>Maximum number of rows in the variable. This maximum is used to allocate memory on the simulator during load. The variable can contain fewer rows than this maximum.</td></tr><tr><td><strong>Max dataset size</strong></td><td>Maximum size of a dataset. This size corresponds to the maximum size for each output.</td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="221.800048828125">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Dataset Select</strong></td><td>Scalar value used to select the dataset during the simulation. This value corresponds to the row number saved in the variable.</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="221">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Status</strong></td><td>Status flag: 1 = OK; -1 = Output is trimmed; -2 = Bad file name.</td></tr><tr><td><strong>Dataset size</strong></td><td>Array containing the size of each dataset.</td></tr><tr><td><strong>Data 1</strong></td><td>Data from the first column of the selected dataset.</td></tr></tbody></table>

## Characteristics and limitations

<table><thead><tr><th width="220.99993896484375">Characteristic</th><th>Value</th></tr></thead><tbody><tr><td>Direct Feedthrough</td><td>No</td></tr><tr><td>Discrete sample time</td><td>Yes</td></tr><tr><td>XHP support</td><td>No</td></tr><tr><td>Work offline</td><td>No</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/rt-lab/simulink-blocks-reference/rt-lab-library/opdataset.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
