# 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.

• 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.

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.

## Parameters

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.

Specify the method and related parameters for normalizing data as one of these options.

Method

Method Parameters

Description

Z-score

Standard deviation (default)

Center and scale to have mean 0 and standard deviation 1.

Median absolute deviation

Center and scale to have median 0 and median absolute deviation 1.

Norm

Positive numeric scalar (default is 2) or Inf for infinity norm

Scale data by p-norm.

Range

Upper and lower range limits (default is 0 for lower limit and 1 for upper limit)

Rescale range of data to an interval of the form [a, b], where a < b.

Median IQR

Not applicable

Center and scale data to have median 0 and interquartile range 1.

Center

Mean (default)

Center to have mean 0.

Median

Center to have median 0.

Numeric scalar

Shift center by a specified numeric value.

From workspace

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

Standard deviation (default)

Scale data by standard deviation.

Median absolute deviation

Scale data by median absolute deviation.

First element

Scale data by first element of data.

Interquartile range

Scale data by interquartile range.

Numeric scalar (default is 1)

Scale data by dividing by a specified numeric value.

From workspace

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 scaleSee the Center and Scale method parametersBoth center and scale data using the specified parameters.

expand all

## Version History

Introduced in R2021b

expand all