MATLAB Answers

How to scale a value in matlab

조회 수: 57(최근 30일)
A R
A R 2020년 2월 21일
댓글: A R 2020년 2월 25일
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!!

답변(1개)

Bhaskar R
Bhaskar R 2020년 2월 21일
req_data = rescale(data, 0, 5);
  댓글 수: 3
A R
A R 2020년 2월 25일
Thanks!! It really helped.

댓글을 달려면 로그인하십시오.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by