We have published an example in the ThingSpeak documentation that shows you how to train a feedforward neural network to predict temperature. The feedforward neural network is one of the simplest types of artificial networks but has broad applications in IoT. We are collecting data in a ThingSpeak channel and will use the integrated MATLAB analytics.
The data is collected once every minute. Fields 2, 3, 4, and 6 contain wind speed (mph), relative humidity, temperature (F), and atmospheric pressure (hg) data respectively. If you want to read the data from the weather station within MATLAB, use the thingSpeakRead function.
data = thingSpeakRead(12397,'Fields',[2 3 4 6],'DateRange',[datetime('Sep 7, 2016'),datetime('Sep 9, 2016')],... 'outputFormat','table');
To predict the temperature, this example makes use of the Neural Network Toolbox along with the data collected in a ThingSpeak channel. This example can be adapted to other IoT applications. Check out the ThingSpeak documentation for the code and explanation.