Hello everyone,
I am new to ThingSpeak and I am getting data from 2 sensors for liquid measurement onto my thingSpeak channel. I want to create a MATLAB visualization that combines data from 2 fields of the channel, combine the data for a day and display it in the form of scatter or 2-d line plot. How can I do that? I am new to MATLAB and thingSpeak. I am currently using the following code but it is just displaying the chart not the lines or scatter dots in both cases. What could be the problem?
CID = ;
rkey= '';
datetimeStop = dateshift(datetime('now'),'start','hour');
datetimeStart = dateshift(datetime('now'),'start','hour') - hours(130);
t = datetime(2017,9,14);
%data = thingSpeakRead(CID,'DateRange',[datetimeStart,datetimeStop],...
%'Fields',1);
data = thingSpeakRead(CID,'NumPoints',9,...
'Fields',2);
averageData = mean(data);
averageData
x=datetimeStart;
totalLiquid = averageData * 10;
totalLiquid
y=totalLiquid;
thingSpeakScatter(x, y)
I look forward to your answers.
Thanks