MATLAB Answers

How to scale a value in matlab

61 views (last 30 days)
A R
A R on 21 Feb 2020
Commented: A R on 25 Feb 2020
Hi, I have a 1x256 data (modulated data of an image) in the range -8.9 to 48.7 which i want to transmit to analog output pin 0 of MCC USB. (USB 205 has 2 analog output pins) The usb 205 only takes data within 0-5 V. So i converted my 1x256 data to 0-5 V using min and max function and pushed it to the DAQ and it works well.
z=1x256 data
b=min(z)
z1=z-b
c=max(z1)
Now i have to convert b and c values within 0-5V so that I can transmit these values to analog output pin 1 of daq. Please share your suggestions.
Thank you!!

Answers (1)

Bhaskar R
Bhaskar R on 21 Feb 2020
req_data = rescale(data, 0, 5);
  3 Comments
A R
A R on 25 Feb 2020
Thanks!! It really helped.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!