mapfun(value,fromLow,fromHigh,toLow,toHigh)
This function is a copy of the "map" function used in Arduino code.
It takes an input value mapped from a min and max possible value and
scales it to a desired output min and max.
[output] = mapfun(value,fromLow,fromHigh,toLow,toHigh)
value: can be a scalar entry or a matrix of values
fromLow: lowest possible input value
fromHigh: highest possible input value
toLow: lowest desired output value
toHigh: highest possible output value
[output]: output matrix of same size as value
examples:
output = mapfun(-.3,-1,1,0,5)
output =
    1.7500
 output = mapfun([-1 1 -.5 .5],-1,1,0,5)
output =
         0    5.0000    1.2500    3.7500
Created by David Coventry on 1/19/2017
Cita come
David Coventry (2025). mapfun(value,fromLow,fromHigh,toLow,toHigh) (https://it.mathworks.com/matlabcentral/fileexchange/61213-mapfun-value-fromlow-fromhigh-tolow-tohigh), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Compatibilità della piattaforma
Windows macOS LinuxCategorie
- Mathematics and Optimization > Mapping Toolbox > Map Display >
 - Radar > Mapping Toolbox > Map Display >
 
Tag
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
| Versione | Pubblicato | Note della release | |
|---|---|---|---|
| 1.0.0.0 | 
