Mapping of a random number in one range to another range

조회 수: 87 (최근 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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by