Quantcast
Channel: ThingSpeak IoT Community - All Forums
Viewing all articles
Browse latest Browse all 1833

piajola on How to compare channel values, over time?

$
0
0

Hi SilverNodashi,

 

%%http://www.mathworks.com/help/matlab/ref/plot.html?searchHighlight=plot&s_tid=doc_srchtitle
% 209428 silvernodashi
%%%%%numapuan=100;

yi=2017; % initial point in space-time -- as in Star Trek
mi=1;
di=11;
hi=0;
mmi=0;
si=0;
%
yf=2017; %ending point in desired time lapse
mf=1;
df=25;
hf=23;
mmf=59;
sf=59;
%
tini=datetime([yi,mi,di,hi,mmi,si])
tfin=datetime([yf,mf,df,hf,mmf,sf])

% Read from your only found channel

%%%%%aotroTT = thingSpeakRead(209428,'Fields',1,'NumPoints',numapuan,'outputFormat','timetable');
%%%%%botroTT = thingSpeakRead(209428,'Fields',2,'NumPoints',numapuan,'outputFormat','timetable');
%%%%%xotroTT = thingSpeakRead(209428,'Fields',3,'NumPoints',numapuan,'outputFormat','timetable');
%%%%%yotroTT = thingSpeakRead(209428,'Fields',4,'NumPoints',numapuan,'outputFormat','timetable');
%%%%%zotroTT = thingSpeakRead(209428,'Fields',5,'NumPoints',numapuan,'outputFormat','timetable');

aotroTT = thingSpeakRead(209428,'Fields',1,'DateRange',[tini,tfin],'outputFormat','timetable');
botroTT = thingSpeakRead(209428,'Fields',2,'DateRange',[tini,tfin],'outputFormat','timetable');
xotroTT = thingSpeakRead(209428,'Fields',3,'DateRange',[tini,tfin],'outputFormat','timetable');
yotroTT = thingSpeakRead(209428,'Fields',4,'DateRange',[tini,tfin],'outputFormat','timetable');
zotroTT = thingSpeakRead(209428,'Fields',5,'DateRange',[tini,tfin],'outputFormat','timetable');

% Synchronize timestables and fill in (if) missing data using linear interpolation
TT = synchronize(aotroTT,botroTT,xotroTT,yotroTT,zotroTT,'union','linear');

% yyaxis left yyaxis right

% so Plot now
plot(TT.Timestamps,TT.GarageTemp,...
TT.Timestamps,TT.PVTemp,...
TT.Timestamps,TT.UnderPVTemp,...
TT.Timestamps,TT.OutsideTemperature,...
TT.Timestamps,TT.GarageRoofTemp);

title('Tetulo desta cosa pal Canalimenso') %some more
xlabel('lotro tetulo')
legend('xxx','yyy','zzz','---','etc')

Hope this work too ... nice graph but confusing

Almost everything can be done in Thingspeak if you have the data (only 1 SilverNodashi channel found!) 


Viewing all articles
Browse latest Browse all 1833

Trending Articles