FRACLAB Functions Previous page   Next Page
normalize_list

Apply an affine transform to each column of a matrix in order to get each column between two given values.

Syntax
ListOut=normalize_list(ListIn,a,b)

Inputs

ListIn : Matrix whose columns are to be normalized.

a : Minimum of the Output matrix

b : Maximum of the Ouput matrix

Outputs

ListOut :Each column of ListOut is deduced from the application of an affine transform to the same column of ListIn. The minimum of each column of ListOut is a and its maximum is b. If a column of ListIn is constant, then the same column of ListOut will be constant, equal to (a+b)/2.

Example

theta=[0:0.1:2*pi]';
x=3*cos(theta)+1;
y=17*sin(theta)-179;
ListIn=[x,y];
ListOut=normalize_list([x,y],0,1);
x_normalized=ListOut(:,1);
y_normalized=ListOut(:,2);
plot(x,y);Title('Initial shape');figure;
plot(x_normalized,y_normalized);Title('Normalized Shape');