Main Content

Data Types

Grouping variables, categorical data, and dataset arrays

Statistics and Machine Learning Toolbox™ provides two additional data types. Work with ordered and unordered discrete, nonnumeric data using the nominal and ordinal data types. Store multiple variables, including those with different data types, into a single object using the dataset array data type. However, these data types are unique to Statistics and Machine Learning Toolbox. For greater cross-product compatibility, use the categorical or table data types, respectively, available in MATLAB®. For more information see Create Categorical Arrays, Create Tables and Assign Data to Them, or watch Tables and Categorical Arrays.


expand all

nominal(Not Recommended) Arrays for nominal data
ordinal(Not Recommended) Arrays for ordinal data
dummyvarCreate dummy variables
onehotencodeEncode data labels into one-hot vectors
onehotdecodeDecode probability vectors into class labels
gplotmatrixMatrix of scatter plots by group
grp2idxCreate index vector from grouping variable
gscatterScatter plot by group
mat2dataset(Not Recommended) Convert matrix to dataset array
cell2dataset(Not Recommended) Convert cell array to dataset array
struct2dataset(Not Recommended) Convert structure array to dataset array
table2dataset(Not Recommended) Convert table to dataset array
dataset2cell(Not Recommended) Convert dataset array to cell array
dataset2struct(Not Recommended) Convert dataset array to structure
dataset2tableConvert dataset array to table
export(Not Recommended) Write dataset array to file
ismissing(Not Recommended) Find dataset array elements with missing values
join(Not Recommended) Merge dataset array observations


dataset(Not Recommended) Arrays for statistical data


Categorical Data

Dataset Arrays