10:45 am
November 16, 2018

5:12 pm


Gold
October 12, 2015

Hi seaurchin,
In Apps > MATLAB Visualizations create a NEW blank visualization (empty edit window)
Copy/paste blindly the code below, run it, read the docs to make your own magic 🙂
This is enough to help you start
- - - - - - - - - - - - start copy/paste - - - - - - - - - - - -
% Read temperature, humidity data from a ThingSpeak channel
% and visualize the data in a single plot using the MATLAB
% THINGSPEAKPLOT function.
% Channel ID to read data from
readChannelID = 00000; % YOUR CHANNEL NUMBER
fieldID1 = 1; % YOUR FIELD NUMBER ie 1 to 8
fieldID2 = 2; % my case 1 Temp 2 Humid
% Data wanted. Learn more about the THINGSPEAKREAD function in docs (easy :))
[data1,time1] = thingSpeakRead(readChannelID,'Field',fieldID1,'NumDays',1);
[data2,time2] = thingSpeakRead(readChannelID,'Field',fieldID2,'NumDays',1);
% Here data1 & data2 take temperature and humidity, time1 & time2 take the day & hour you sent the data to ThingSpeak.
% 'NumDays',1 mean last day (2 for last 2 days, etc.) ... so you have the data to plot
% Learn more about the THINGSPEAKPLOT function in docs (they do not bite I assure you)
% thingSpeakPlot(time, [ humidityData,temperatureData], 'legend',{'H %', 'T *C'});
thingSpeakPlotYY( time2, data2,time1, data1,...
'YGrid1','on','YLabel1','% H.R.',...
'YLabel2','*C','XLabel','Fecha y hora',...
'Title','Tempix y Humix ultimas 24 horas');
% Here you made the plot, that is all. Pairs of ' ' comma separated to say titles, labels, etc.
% 3 dots are saying: this is to make more readable ONE line ( the function is ONE line)
%Pay a lot of attention to UPPER/lower case, spaces, punctuation marks, etc.
- - - - - - - - - - - - stop copy/paste - - - - - - - - - - - -
This is PLOT from ThingSpeak, there is a plot from Mathworks/Matlab
Any trouble, questions ...
write here again
I hope this is of some help 🙂
2:37 am
November 16, 2018

I got rid of the comments while pasting for sake of tidiness..
I am getting the below error when I try to save and run:
Error using thingSpeakPlotYY (line 18)
Expected input to be nonempty.
Error in Custom (no starter code) 2 (line 9)
thingSpeakPlotYY( time2, data2,time1, data1, 'YGrid1','on','YLabel1','% H.R.', 'YLabel2','*C','XLabel','Fecha y hora','Title','Tempix y Humix ultimas 24 horas');
and when I click line 18 link I get below error :
Error using mlvisualization__user_id_110221_1542440103 (line 1)
Unable to run the 'mlvisualization__user_id_110221_1542440103' function because it calls the 'opentoline' function, which is not supported for this product offering.
11:02 am
November 16, 2018

1:28 pm


Gold
October 12, 2015

It seems that we are awake at different times (and the visit to the forum)
Yes, Visualizations are not "live" (F5 press needed)
I did not know you wanted a real-time graph ...
In my TS dashboard for a "live" Temp-Hum graph I have a simple Apps>Plugins with the classic
-HTML
-CSS
-JavaScript
where you set the refresh rate in case you will be interested ...
12:01 am
November 16, 2018

piajola said
It seems that we are awake at different times (and the visit to the forum)
Yes, Visualizations are not "live" (F5 press needed)I did not know you wanted a real-time graph ...
In my TS dashboard for a "live" Temp-Hum graph I have a simple Apps>Plugins with the classic
-HTML
-CSS
-JavaScriptwhere you set the refresh rate in case you will be interested ... Â
yea, I am in Beijing.
I realised the visualisation added to Thingspeak for embedding uses iframe so I can add refresh to it, or I can completely not use matlab visualisation and use google chart api which is quite easy to do..
Most Users Ever Online: 166
Currently Online:
27 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
rw950431: 272
Vinod: 240
piajola: 95
turgo: 70
vespapierre: 63
Adarsh_Murthy: 62
Member Stats:
Guest Posters: 1
Members: 8665
Moderators: 1
Admins: 2
Forum Stats:
Groups: 3
Forums: 14
Topics: 1600
Posts: 5760
Newest Members:
Advantagetreeexperts, laundrydaddyuk, techhhelp5, ken, tran, huldacormierModerators: cstapels: 460
Administrators: Hans: 405, lee: 457