필터 지우기
필터 지우기

plotting 2d sensor data

조회 수: 1 (최근 30일)
Jatin Arora
Jatin Arora 2013년 5월 17일
I have a sensor data whose value varies from 0 to 65536 as the data type is uint16. I want to draw a 2D plot which should vary from -3000 to +3000 on X-axis with respect to time.
For example if in my data set I get
0 equivalent to -3000
32768 equivalent to 0
65536 equivalent to 3000
Please kindly excuse if the question is very trivial as I am beginner to MATLAB.
Thanks
  댓글 수: 2
José-Luis
José-Luis 2013년 5월 17일
If your data is uint16 then it varies from 0 to 65535.
Jatin Arora
Jatin Arora 2013년 5월 17일
Thanks Jose-Luis for pointing out the mistake

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

채택된 답변

José-Luis
José-Luis 2013년 5월 17일
편집: José-Luis 2013년 5월 17일
your_data = uint16(randi(65536,1000,1)-1);
scaled_data = -3000 + round(6000 .* (double(your_data) ./ 65536));
Please accept an answer if it helps you.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by