File Exchange Pick of the Week

Our best user submissions

ThingSpeak Support for MATLAB

Sean's pick this week is ThingSpeak Support for MATLAB by MathWorks' Internet of Things Team.  


The Internet of Things

Up until recently, I'd heard the phrase the "internet of things" thrown around only a few times and didn't really know what it meant. So I spoke with our Marketing Manager for the Maker Movement, Paul Kassebaum, to get a better understanding. Paul describes it briefly as "The confluence of technologies in communication (the internet as we know it), the energy internet (or energy from sensors, etc.) and the logistics internet (the ability to use this information for logistics)." This week's pick uses all three. It allows you to pull data directly into MATLAB from ThingSpeak, a platform and cloud service where data can be uploaded from sensors and low cost hardware. After pulling this data, you can use it for whatever research, design or logistics you want.


I saw this submission on File Exchange that described measuring soda consumption here at MathWorks. This made a challenge for me: Could I gather a few people together, drink as much Powerade as possible at 4pm Eastern Time on August 5th, and create an outlier data point? We had a few detractors, like Loren, who did not properly appreciate the health benefits of this type of social gathering. To passerbyers, it probably looked like we were part of some obscure MATLAB cult. Let's see how we did:

Download the Data

% Grab the data for July 6th through August 6th.
[drinkData, timeStamps] = thingSpeakFetch(7040,'DateRange',{'06-July-2014','06-August-2014'});
Powerade = drinkData(:,3); % Third channel is Powerade

% Index into the party hour
idxParty = hour(timeStamps)==16 & day(timeStamps) == 5 & month(timeStamps)==8;


scatter(timeStamps(idxParty),Powerade(idxParty),400,'MarkerFaceColor',[0.03 0.6 0.8],'MarkerEdgeColor',[0.03 0.6 0.8]);
hold on
scatter(timeStamps,Powerade,15,'MarkerFaceColor',[0.5 0 0],'MarkerEdgeColor',[0.5 0 0]);
legend('Powerade Party','Powerade Consumption','location','northwest')
So it does look like we were able to create a Powerade Consumption outlier. Go Team!


Give it a try and let us know what you think here or leave a comment for our Internet of Things team.

Published with MATLAB® R2014a

  • print


コメントを残すには、ここ をクリックして MathWorks アカウントにサインインするか新しい MathWorks アカウントを作成します。