FeedForward Neural Network on ThingSpeak Channel

65 views Asked by At

I am doing a project and I have code of a few lines in MATLAB which is trained and tested on a given data set with 70-30 % distribution. This is the code:

clc
clear all
close all
x=xlsread('Training');
y=xlsread('Output');
t=xlsread('Test');
x=x';
y=y';
t=t';
net=feedforwardnet(50);
net.layers{1},transferFCN='gaussian';
net.layers{2},transferFCN='hyperbolic tan';
view(net);
net=train(net,x,y)
a=sim(net,t)

Now My live data is coming in a ThingSpeak channel (There are total 6 fields in the channel ) and I want to analyze that data through this code and take decisions. What changes I should make to run it in ThingSpeak as a MATLAB Analysis? Any help is appreciated.

Thanks.

1

There are 1 answers

0
iohans On

Your lines:

x=xlsread('Training');
y=xlsread('Output');
t=xlsread('Test');

will now come from a ThingSpeak channel. Here's an example of thingSpeakRead in MATLAB:

data = thingSpeakRead(12397,'Fields',[1,4],NumPoints=3,OutputFormat='TimeTable')

Here's the doc for thingSpeakRead.