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

New to MATLAB?

How can I normalize data between 0 and 1 ? I want to use logsig...

Asked by Platon

Platon (view profile)

on 13 May 2013

All is in the question: I want to use logsig as a transfer function for the hidden neurones so I have to normalize data between 0 and 1. The mapminmax function in NN tool box normalize data between -1 and 1 so it does not correspond to what I'm looking for.

0 Comments

Platon

Platon (view profile)

Products

No products are associated with this question.

2 Answers

Answer by José-Luis

José-Luis (view profile)

on 15 May 2013
Accepted answer
 bla = 100.*randn(1,10)
 norm_data = (bla - min(bla)) / ( max(bla) - min(bla) )

2 Comments

Platon

Platon (view profile)

on 15 May 2013

Thank you for your response. But if I do the normalization manually and train the NN with the normalized data, how can I test the net with new data? normalize them before simulation? if so how can I de-normalize the output calculated from unseen data? It seems complicated (mapminmax do all the stuff automatically)

José-Luis

José-Luis (view profile)

on 15 May 2013

Yes, provided you use the same normalization bounds (the min and max of both datasets). To rescale, please look at the below code.

bla = 100.*randn(1,10)
minVal = min(bla);
maxVal = max(bla);
norm_data = (bla - minVal) / ( maxVal - minVal )
your_original_data = minVal + norm_data.*(maxVal - minVal)
José-Luis

José-Luis (view profile)

Answer by Jurgen

Jurgen (view profile)

on 15 May 2013
NDATA = mat2gray(DATA);

0 Comments

Jurgen

Jurgen (view profile)

Contact us