Hans on IoT

ThingSpeak, MATLAB, and the Internet of Things

Explore your IoT data with ThingSpeak and MATLAB

Posted by Hans Scharler,

Loren Shure, a blogger at MATLAB Central, has written a new blog post about Eric Wetjen’s Counting Cars and Analyzing Traffic project. Eric uses a Raspberry Pi and webcam to capture traffic data outside of the MathWorks headquarters in Natick, MA. All of the traffic data is stored on a public ThingSpeak channel, so you will be able to use it to learn data analysis with the built-in MATLAB Analysis and Visualizations apps in ThingSpeak.

MATLAB car counting display

Loren explores the data using MATLAB Analysis and MATLAB Visualizations app built into ThingSpeak.

Offline Analysis: Analyzing Data stored on ThingSpeak

If you have desktop MATLAB, you can gain even more insights into our traffic data or any of your ThingSpeak Channels. You need to first import the data from ThingSpeak into desktop MATLAB. To simplify the retrieval of the data from ThingSpeak, we use the functions from the ThingSpeak Support Toolbox, available on MATLAB Central File Exchange.

readChannelID = 38629;
readAPIKey = '8NPXB8G515OAD94Q';

%% Read Data %%
[data, time] = thingSpeakRead(readChannelID,'DateRange',[datetime('Mar 13, 2016'),datetime('Mar 14, 2016')],'ReadKey', readAPIKey);

[via Loren on the Art of MATLAB]

Add A Comment

Your email address will not be published. Required fields are marked *

Preview: hide