採用された回答

Stephan
Stephan 2019 年 3 月 18 日
編集済み: Stephan 2019 年 3 月 18 日

0 投票

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

2 件のコメント

Guido Pastore
Guido Pastore 2019 年 3 月 18 日
Thank you so much
Stephan
Stephan 2019 年 3 月 18 日
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.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Data Types についてさらに検索

タグ

質問済み:

2019 年 3 月 18 日

コメント済み:

2019 年 3 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by