Mapping of a random number in one range to another range

89 ビュー (過去 30 日間)
Omkar Bhanap
Omkar Bhanap 2018 年 1 月 28 日
コメント済み: Omkar Bhanap 2018 年 1 月 28 日
How to re-map a number from one range to another in MATLAB. I've a random number in the range 0 to 5. Now I want to convert it into range of 12.5 to 37.5 . Please help me out for this problem.

採用された回答

Stephen23
Stephen23 2018 年 1 月 28 日
編集済み: Stephen23 2018 年 1 月 28 日
A trivial solution using interp1:
>> num = 2.3;
>> interp1([0,5],[12.5,37.5],num)
ans = 24

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by