Scaling a variable in MATLAB when interfacing with Arduino

1 view (last 30 days)
I am trying to rescale/remap a variable that is reading from an analog input from my Arduino. The values from the analog port are concatenated to a 1-by-1000 preallocated matrix and plotted in real-time using drawnow within a while loop.
At the moment the resolution from the Arduino is 0-1023, and I want it to be between 0-100, like in my original Arduino sketches. Obviously we use the map() function within the Arduino IDE, but what options have I got with the MATLAB environment?

Answers (0)

Categories

Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!