dividing value by 100
2 次查看(过去 30 天)
显示 更早的评论
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);
回答(3 个)
wael elsisi
2021-7-18
编辑:Image Analyst
2021-7-18
1 个评论
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?
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 个评论
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 Community
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Prepare and Analyze Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




