Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 其它 > 资料存档 > MATLAB技术文章
MATLAB技术文章 MATLAB Technical Articles From Mathworks
回复
 
主题工具 显示模式
旧 2019-11-24, 16:39   #1
poster
高级会员
 
注册日期: 2019-11-21
帖子: 3,006
声望力: 66
poster 正向着好的方向发展
默认 Internet of Things – How to Get Started



Internet of Things – How to Get Started
1



Posted by Loren Shure,








I'm sure you've heard of IoT, Internet of Things. And people talk about connected devices, and getting the data from them to use in applications. I want to show you a very simple example to spark some ideas in each of you.

Contents

Example

IoT allows you access or serve data that is not local to users who want to use it. We have the ThingSpeak portion of our website that you can use to access and analyze live streamed data in the cloud. And we recently added the ability to access these same channels of information directly from a MATLAB session when you have internet access. Here's an example of some simple weather day you can access, including windspeed (mph), humidity, and temperature (F). The first thing I'll do is grab these 3 channels of information for 3 days.

data = thingSpeakRead(12397,'Fields',2:4,'NumDays',3,'OutputFormat', ...
'TimeTable');

Let's preview the data with topkrows.

topkrows(data,8)
ans =
8×3 timetable
Timestamps WindSpeedmph Humidity TemperatureF
____________________ ____________ ________ ____________
09-Jul-2019 09:29:03 3.3 36 82.4
09-Jul-2019 09:28:02 4.2 37 82.3
09-Jul-2019 09:27:01 5 37 82.3
09-Jul-2019 09:25:59 2.8 37 82.2
09-Jul-2019 09:24:58 2.9 37 82.1
09-Jul-2019 09:23:58 4.3 37 82.1
09-Jul-2019 09:22:55 2.8 37 82.1
09-Jul-2019 09:21:54 2.8 37 81.9

I asked for the data to be returned in a timetable. How many points did I collect?

numDataPoints = height(data)
numDataPoints =
4228

Let's look at the data now. It's interesting to compare the trends of the data we chose to view. I'm using a stackedplot

h = stackedplot(data);

IoT

If you are interested in learning more about IoT with MATLAB, I highly recommend reading Hans's blog.

Let me know how you might take advantage of ThingSpeak here.


Get the MATLAB code













More...
poster 当前离线   回复时引用此帖
回复


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛启用 HTML 代码



所有时间均为北京时间。现在的时间是 23:39


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.