How to normalize data between 0 and -1.4?

I have seen the min-max normalization formula but that normalizes values between 0 and 1. How would I normalize my data between 0 and -1.4? I have both negative and positive values in my data matrix.

回答 (1 件)

James Tursa
James Tursa 2017 年 5 月 25 日
編集済み: James Tursa 2017 年 5 月 25 日

0 投票

E.g., using simple linear scaling based on the range of the current data:
data = your matrix
actual_min = min(data(:));
actual_max = max(data(:));
desired_min = -1.4;
desired_max = 0.0;
result = (data - actual_min)*((desired_max - desired_min)/(actual_max - actual_min)) + desired_min;

1 件のコメント

ahmed free
ahmed free 2017 年 5 月 25 日
thanks a lot , i appreciate it

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

カテゴリ

ヘルプ センター および File ExchangeVehicle Dynamics Blockset についてさらに検索

タグ

質問済み:

2017 年 5 月 24 日

コメント済み:

2017 年 5 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by