List names of Dataset variables in MAT-file


varNames = Simulink.SimulationData.DatasetRef.getDatasetVariableNames(matFile)



varNames = Simulink.SimulationData.DatasetRef.getDatasetVariableNames(matFile) lists the names of variables for Dataset data in a MAT-file.


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.

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.

Input Arguments

collapse all

MAT-file that contains Dataset variables, specified as a character vector. The character vector specifies the path to the MAT-file.

Output Arguments

collapse all

Names of Dataset variables in MAT-file, returned as a cell array.

Introduced in R2016a

Was this topic helpful?