Normalize Data
Center and scale data in the Live Editor
Description
The Normalize Data task lets you interactively normalize data by choosing centering and scaling methods, such as zscore. The task automatically generates MATLAB^{®} code for your live script.
Using this task, you can:
Customize how to center and scale data in a workspace variable such as a table or timetable.
Automatically visualize the input data compared to the normalized data.
Output the centering and scaling values used to compute the normalization.
Open the Task
To add the Normalize Data task to a live script in the MATLAB Live Editor:
On the Live Editor tab, click Task and select the Normalize Data icon .
In a code block in the live script, type a relevant keyword, such as
normalize
. Select Normalize Data from the suggested command completions.
Examples
Parameters
Input data
— Valid input data from workspace
vector  table  timetable
This task operates on data of type single
or
double
. The data can be contained in a vector or table
variables.
When providing a table or timetable for the input data, specify All supported variables to normalize all variables with a supported type. To choose specific supported variables to normalize, select Specified variables and then select the variables individually.
Normalization method
— Method and parameters for normalizing data
Zscore
(default)  Norm
 Range
 ...
Specify the method and related parameters for normalizing data using one of these options:
Method  Method Parameters  Description 

 Center and scale to have mean 0 and standard deviation 1.  
 Center and scale to have median 0 and median absolute deviation 1.  
 Positive numeric scalar (default is 2) or  Scale data by pnorm. 
 Left and right range limits (default is 0 for left limit and 1 for right limit)  Rescale range of data to an interval of the form [a
b] , where a < b . 
 Center and scale data to have median 0 and interquartile range 1.  

 Center to have mean 0. 
 Center to have median 0.  
 Shift center by specified numeric value.  
 Shift center using values in a numeric array or in a table whose variable names match the specified table variables from the input data.  

 Scale data by standard deviation. 
 Scale data by median absolute deviation.  
 Scale data by first element of data.  
 Scale data by interquartile range.  
Numeric scalar (default is 1)  Scale data by dividing by a numeric value.  
 Scale data using values in a numeric array or in a table whose variable names match the specified table variables from the input data.  
Center and scale  Both center and scale data using parameters from the
Center and Scale methods above 
More About
Version History
Introduced in R2021bSee Also
Functions
Live Editor Tasks
 Clean Outlier Data  Clean Missing Data  Find Local Extrema  Smooth Data  Remove Trends  Find Change Points  Compute by Group