File Exchange

image thumbnail

ThingSpeak support from MATLAB (R2013a-R2014a)

Prototype Internet of Things applications using ThingSpeak and MATLAB


Updated 08 Dec 2016

View License

If using R2014b or later, download the following updated submission to connect to ThingSpeak.
This submission for R2013a, R2013b and R2014a enables MATLAB to access sensor data stored on ThingSpeak.
ThingSpeak is an IoT analytics platform that lets you collect and store sensor data and develop Internet of Things applications. ThingSpeak support from MATLAB lets you analyze and visualize data stored on or on private installations of the ThingSpeak server. The submission also includes a pdf file which documents the function.
For more information see:

Comments and Ratings (4)

Björn Skatt

Thank you. Works perfect.

When I use webread to read a table, I get the data but it takes a while to reformat it. If not all fields are set every time, webread provides no way of telling on which entries the fields were left out.

thingSpeakFetch formats the table for me and fills it with NaN where left empty.

Could you perhaps open up the source code? It would be interesting to see how you make that translation.


syed (view profile)

I am trying to access my private thingspeak server which is running on my own laptop. I am using the following syntax but get matlab operator error

[d,t] = thingSpeakFetch(6,'NumPoints',10,'URL',;

Error: Unexpected MATLAB operator.

Is the problem using Do I need to associate a name not an IP address?
I tried localhost:3000 also but get same error message. I can access my own thingspeak server with typing in localhost:300 or

Syed, the particular command you are attempting to execute is to fetch data from a private ThingSpeak installation. To fetch data from a public channel on, use the syntax format specified in Example 1 to Example 3. Change the channel number in the example to the channel that you want to fetch data from.

Thank you.. Looking for such feature.


Updated description.

Updated description indicating a new version available for R2014b and higher.

Updated examples and documentation.

Added new IoT resource link in description.

Corrected description.

Updated file and description.

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: thingSpeakWriterClass

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.

Learn About Live Editor