This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


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