Documentation Home Page ◇ HYPERSIM Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.
Data Logger For MATLAB
This page describes the steps to read a .oprec file in Matlab
Supported Versions
This feature is available from MATLAB 2018a and Hypersim 2022.2.0.
Setup
Open your MATLAB version.
Go to C:\OPAL-RT\HYPERSIM\hypersim_2022.3.0.o281\Windows\hyperlink\datalogger folder that contains the .m scripts.
Copy this path into Matlab folder directory as shown in the picture below
This directory should be similar to: C:\OPAL-RT\HYPERSIM\hypersim_2022.2.0.o281\Windows\hyperlink\datalogger.
Both OpRecInfo and OpRecRead are available to retrieve information and/or read data from OPAL Record files (.oprec).
Script usage
OpRecInfo
This script allows retrieving metadata from .oprec files.
Parameter
- Full Oprec file path
Usage
OpRecInfo('C:\Data\SignalGroup_1.oprec');
Just provide a full path to the .oprec file to retrieve the following information:
- Time step (in seconds)
- Minimal timestamp (in seconds): first simulation step recorded.
- Maximum timestamp (in seconds): last simulation step recorded.
- The count and the list of all recorded signals.
Output example
OpRecRead
This script allows retrieving data for all recorded signals.
Parameters
- Full Oprec file path
- [optional] the first timestamp to read. By default, this corresponds to the timestamp of the first recorded step.
This value is adjusted in case the specified timestamp is lower than the timestamp of the first recorded step.
This parameter is mandatory when the last timestamp is specified (see below). - [optional] the last timestamp to read. By default, this corresponds to the timestamp of the last recorded step.
This value is adjusted in case the specified timestamp is greater than the timestamp of the last recorded step.
Usage
[header, data] = OpRecRead('C:\Data\SignalGroup_1.oprec');
Provide two output parameters to store the data read from the .oprec file:
- The first parameter will store the signal names and types.
- The second parameter will store all the step data for the signals in the exact same order as in the first parameter.
Output examples
OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter