Akzeptierte Antwort

Stephan
Stephan am 18 Mär. 2019
Bearbeitet: Stephan am 18 Mär. 2019

0 Stimmen

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

2 Kommentare

Guido Pastore
Guido Pastore am 18 Mär. 2019
Thank you so much
Stephan
Stephan am 18 Mär. 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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Types finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 18 Mär. 2019

Kommentiert:

am 18 Mär. 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by