Main Content

mapstd

Process matrices by mapping each row’s means to 0 and deviations to 1

Syntax

[Y,PS] = mapstd(X,ymean,ystd)
[Y,PS] = mapstd(X,FP)
Y = mapstd('apply',X,PS)
X = mapstd('reverse',Y,PS)
dx_dy = mapstd('dx_dy',X,Y,PS)

Description

mapstd processes matrices by transforming the mean and standard deviation of each row to ymean and ystd.

[Y,PS] = mapstd(X,ymean,ystd) takes X and optional parameters,

X

N-by-Q matrix

ymean

Mean value for each row of Y (default is 0)

ystd

Standard deviation for each row of Y (default is 1)

and returns

Y

N-by-Q matrix

PS

Process settings that allow consistent processing of values

[Y,PS] = mapstd(X,FP) takes parameters as a struct: FP.ymean, FP.ystd.

Y = mapstd('apply',X,PS) returns Y, given X and settings PS.

X = mapstd('reverse',Y,PS) returns X, given Y and settings PS.

dx_dy = mapstd('dx_dy',X,Y,PS) returns the reverse derivative.

Examples

Here you format a matrix so that the minimum and maximum values of each row are mapped to default mean and STD of 0 and 1.

x1 = [1 2 4; 1 1 1; 3 2 2; 0 0 0]
[y1,PS] = mapstd(x1)

Next, apply the same processing settings to new values.

x2 = [5 2 3; 1 1 1; 6 7 3; 0 0 0]
y2 = mapstd('apply',x2,PS)

Reverse the processing of y1 to get x1 again.

x1_again = mapstd('reverse',y1,PS)

More About

collapse all

Algorithms

The function assumes that X only contains finite real values. Additionally, the result for each row depends on the elements in that row.

  • If the elements of the row are not all equal, then the function transforms the mean and standard deviation of each row to ymean (default 0) and ystd (default 1).

    y = (x-xmean)*(ystd/xstd) + ymean;
    

  • If the elements of the row are all equal, then the function does not modify the data in that row (y=x).

Version History

Introduced in R2006a