Library
rtlab/Data logging
Block
This block reads a cell array table from a Matlab binary file (*.mat) and outputs the selected column (dataset).
Mask
Parameters
Real-Time Path | Path where the file is located when the simulation is running on the target node. |
---|---|
Non Real-Time Path | Path where the file is located when the model is running on the Command Station (Running under Windows OS). |
Variable Name | Name of the variable saved in the .mat file. The variable should be saved in the Matlab V6 format. See example below on how to create and save the variable to a mat file. |
Number of outputs | The number of outputs will correspond to the number of columns in the variable. |
Max number of datasets | The max number of datasets is the maximum number of rows in the variable. This maximum is used to allocate memory on the Real-Time target node during load. The variable can contain fewer rows than the maximum number of datasets. |
Max dataset size | Maximum size of a dataset. This size corresponds to the maximum size for each output. |
Inputs
Dataset Select | A scalar value used to select the dataset during the simulation. This value corresponds to the row number saved in the variable. |
---|
Outputs
Status:
Value | Status |
---|---|
1 | OK |
-1 | Output is trimmed |
-2 | Bad file name |
Dataset size: Array containing the size of each dataset.
Data 1: Data from the first column of the selected dataset
M Script Example to Create One Dataset
%Dataset #1
RPPs{1,1}=zeros(1,20); %Output #1
RPPs{1,2}=zeros(1,5)+1; %Output #2
RPPs{1,3}=zeros(1,15)+2; %Output #3
RPPs{1,4}=zeros(1,20)+3; %Output #4
%Dataset #2
RPPs{2,1}=zeros(1,20)+10; %Output #1
RPPs{2,2}=zeros(1,20)+11; %Output #2
RPPs{2,3}=zeros(1,20)+12; %Output #3
RPPs{2,4}=zeros(1,20)+13; %Output #4
%Dataset #3
RPPs{3,1}=[1:20]; %Output #1
RPPs{3,2}=[20:-1:1]; %Output #2
RPPs{3,3}=[100:5:200]; %Output #3
RPPs{3,4}=ones(1,10); %Output #4
%Saving RPPs variable to my_dataset.mat
%Note: Variable should be saved in V6 format
save my_dataset.mat RPPs -V6
Characteristics and Limitations
Direct Feedthrough | No |
---|---|
Discrete sample time | Yes |
XHP support | No |
Work offline | No |
Example Model
/Examples/Features/OpDataSet