Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

How to normalize given matrix in the range of [-11] ?

Asked by Kunal yawle on 27 Apr 2013

%# Decide the labels and normalize instance matrix into range [1, -1] [train_inp avgMatrix mRows mCols] = getNormalMatrix('SVMDATA2.xlsx','Oct','A1:C1464');

0 Comments

Kunal yawle

Products

1 Answer

Answer by Iman Ansari on 27 Apr 2013

Hi.

A=randi(100,[10 10 10]);
% Between [0 1]
A=(A-min(A(:)))./(max(A(:))-min(A(:)));
A=2.*A -1;

1 Comment

Kunal yawle on 29 Apr 2013

thank you very much.... the code works..!!!

Iman Ansari

Contact us