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 z-score. 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.
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
. SelectNormalize Data
from the suggested command completions.
Examples
Parameters
Input data
— Valid input data from workspace
vector | table | timetable
This task operates on input data contained in a vector, table, or timetable. The
data can be of type single
or double
.
For table or timetable input data, to clean all variables with type
single
or double
, select All
supported variables
. To choose which single
or
double
variables to clean, select Specified
variables
.
Normalization method
— Method and parameters for normalizing data
Z-score
(default) | Norm
| Range
| ...
Specify the method and related parameters for normalizing data as one of these options.
Method | Method Parameters | Description |
---|---|---|
| Center and scale to have mean | |
| Center and scale to have median | |
| Positive numeric scalar (default is | Scale data by p-norm. |
| Upper and lower range limits (default is | Rescale range of data to an interval of the form [a,
b] , where a < b . |
| Not applicable | Center and scale data to have median |
|
| Center to have mean 0 . |
| Center to have median 0 . | |
| Shift center by a 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 specified 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 | See the Center and Scale method
parameters | Both center and scale data using the specified parameters. |
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