ThingSpeak is MathWorks’ IoT platform. You can use ThingSpeak for free for non-commercial small projects, but you can also purchase a license with enhanced capabilities, such as the ability to send/receive more messages at a higher frequency.
This Toolbox allows you to connect to ThingSpeak directly from your MATLAB to send and receive data. The Toolbox has been around for several years, and you can download this from the File Exchange or from the Add-on Explorer.
Great news to those who have R2019a or newer. Now, this functionality comes built in with your MATLAB! You can start interacting with ThingSpeak right away.
Here’s an example of reading the last 3 days’ worth of data from the MathWorks Weather Station, located in Natick, MA in U.S.A. Below, the fields 2, 3, and 4 are wind speed, humidity, and temperature, respectively.
data = thingSpeakRead(12397,'Fields',2:4,'NumDays',3,'OutputFormat','TimeTable'); numDataPoints = height(data)
numDataPoints = 4218
Now, we’ll use stackedplot to visualize the 3 data sets.
Get the MATLAB code
Published with MATLAB® R2019a
Comments are closed.