Mapping of a random number in one range to another range

87 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Stephen23
Stephen23 el 28 de En. de 2018
Editada: Stephen23 el 28 de En. de 2018
A trivial solution using interp1:
>> num = 2.3;
>> interp1([0,5],[12.5,37.5],num)
ans = 24

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by