Transfer data into and out of MATLAB® using several different file formats. Valid formats include
tabular data, tab-delimited files, Microsoft®
Excel® spreadsheets, and SAS®
XPORT files. For a table of supported file formats and their
associated import and export functions, see Supported File Formats for Import and Export. Alternatively, you can import data
interactively by using the Import Tool. Statistics and Machine Learning Toolbox™ supports many, but not all, of the data types available in
MATLAB. For more information, see Supported Data Types.
dataset data types are unique to Statistics and Machine Learning Toolbox, and are no longer recommended. For greater cross-product
compatibility, use the
table data types available in
MATLAB. For more information, see Create Categorical Arrays or
Create Tables and Assign Data to Them, or watch Tables and Categorical Arrays.
Data Import and Export
|Create dummy variables
|Encode data labels into one-hot vectors (Since R2021b)
|Decode probability vectors into class labels (Since R2021b)
|Matrix of scatter plots by group
|Create index vector from grouping variable
|Scatter plot by group
|(Not Recommended) Arrays for nominal data
|(Not Recommended) Arrays for ordinal data
|(Not Recommended) Convert matrix to dataset array
|(Not Recommended) Convert cell array to dataset array
|(Not Recommended) Convert structure array to dataset array
|(Not Recommended) Convert table to dataset array
|(Not Recommended) Convert dataset array to cell array
|(Not Recommended) Convert dataset array to structure
|Convert dataset array to table
|(Not Recommended) Write dataset array to file
|(Not Recommended) Find dataset array elements with missing values
|(Not Recommended) Merge dataset array observations
|(Not Recommended) Arrays for statistical data
- Sample Data Sets
Data sets contain individual data variables, description variables with references, and dataset arrays encapsulating the data set and its description, as appropriate.
- Grouping Variables
Grouping variables are utility variables used to group or categorize observations.
- Dummy Variables
Dummy variables let you adapt categorical data for use in classification and regression analysis.
- Test Differences Between Category Means
Test for significant differences between category (group) means using a t-test, two-way ANOVA (analysis of variance), and ANOCOVA (analysis of covariance) analysis.
- Linear Regression with Categorical Covariates
Perform a regression with categorical covariates using categorical arrays and