MATLAB Answers

0

Normalization of a vector

Asked by Guido Pastore on 18 Mar 2019
Latest activity Commented on by Stephan
on 18 Mar 2019
How do I normalize an array of double from -1 and +1?

  0 Comments

Sign in to comment.

Tags

1 Answer

Stephan
Answer by Stephan
on 18 Mar 2019
Edited by Stephan
on 18 Mar 2019
 Accepted Answer

result = normalize(v,'range',[-1 1])
where v is your vector

  2 Comments

Thank you so much
Stephan
on 18 Mar 2019
you may also be interested in:
v = [-2 -1 0; 0.5 1.5 2; 0 2 -1]
result = rescale(v,-1, 1)
which works for arrays. Compare the results of both approaches and choose the option that meets your needs.

Sign in to comment.