dividing value by 100

조회 수: 2 (최근 30일)
wael elsisi
wael elsisi 2021년 7월 18일
댓글: Image Analyst 2021년 7월 25일
I want to divide my data by 100
How to do it in MATLAB Analysis ?
data = thingSpeakRead(readChannelID, 'ReadKey', readAPIKey);
data = thingSpeakRead(readChannelID, 'ReadKey', readAPIKey)/100;
should I use write part ?
thingSpeakWrite(writeChannelID, analyzedData, 'WriteKey', writeAPIKey);
  댓글 수: 1
Image Analyst
Image Analyst 2021년 7월 18일
How about
data = data / 100;

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

답변 (3개)

wael elsisi
wael elsisi 2021년 7월 18일
편집: Image Analyst 2021년 7월 18일
Thank you for your support.
I have tried your way but I got wired data.
send_windSpeed = thingSpeakRead(readChannelID, 'ReadKey', readAPIKey);
send_windSpeed = send_windSpeed/100;
  댓글 수: 1
Image Analyst
Image Analyst 2021년 7월 18일
What do you mean by "wired data"? Did it, or did it not, divide your send_windSpeed values by 100?

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


wael elsisi
wael elsisi 2021년 7월 18일
instead of getting float data I've got Integer value.
I have multiplay the value by 100.
Then I have asigned the result to high and low byte.
Then send data to thingspeak.
now I want to get the data on thingspeak.
I use Sigfox.
  댓글 수: 1
John D'Errico
John D'Errico 2021년 7월 18일
Please don't use an answer to make a comment.

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


Image Analyst
Image Analyst 2021년 7월 18일
편집: Image Analyst 2021년 7월 18일
To divide by 100, how about
send_windSpeed = send_windSpeed / 100;
You said you're getting integers. So, in your code
send_windSpeed = thingSpeakRead(readChannelID, 'ReadKey', readAPIKey);
send_windSpeed = send_windSpeed/100;
is send_windSpeed integer or floating point after the first line of code where you call thingSpeakRead()? The second line should not change it from floating point to integer.
To multiply by 100, you simply use * instead of /, like this:
send_windSpeed = send_windSpeed * 100;
Please reply as a comment to this (my) answer, not as a brand new answer to your original question.
  댓글 수: 24
wael elsisi
wael elsisi 2021년 7월 25일
Sorry for annyoing you.
My data still as it was.
Image Analyst
Image Analyst 2021년 7월 25일
Did you replot the data after it was divided by 100? Just dividing the array won't do a replot automatically. That is a separate step you must do explicitly.

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

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

카테고리

Help CenterFile Exchange에서 Prepare and Analyze Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by