List names of Dataset variables in MAT-file
Dataset
varNames = Simulink.SimulationData.DatasetRef.getDatasetVariableNames(matFile)
example
varNames = Simulink.SimulationData.DatasetRef.getDatasetVariableNames(matFile) lists the names of variables for Dataset data in a MAT-file.
matFile
collapse all
Suppose that you simulate a model using the default variable names for signal logging data and states data. You enable the Configuration Parameters > Data Import/Export > Log Dataset data to file and use the default MAT-file name of out.mat.
out.mat
List the variable names in the MAT-file.
varNames = Simulink.SimulationData.DatasetRef.getDatasetVariableNames('out.mat')
varNames = 'xout' 'logsout'
To get the names of Dataset variables in the MAT-file, using the Simulink.SimulationData.DatasetRef.getDatasetVariableNames function processes faster than using the who, or whos functions.
Simulink.SimulationData.DatasetRef.getDatasetVariableNames
who
whos
MAT-file that contains Dataset variables, specified as a character vector. The character vector specifies the path to the MAT-file.
varNames
Names of Dataset variables in MAT-file, returned as a cell array.
Simulink.SimulationData.Dataset | Simulink.SimulationData.DatasetRef
Simulink.SimulationData.Dataset
Simulink.SimulationData.DatasetRef