Unrecognized function or variable 'thingSpeakPlot'.

warda Nemouchi on 6 Jun 2021 (Edited on 6 Jun 2021)
Latest activity Reply by warda Nemouchi on 10 Jun 2021

Hello, I'm new to thingspeak, i want to combine 4 fields in one chart, i have used the code below

readChannelID = 1408944; % YOUR CHANNEL NUMBER
fieldID1 = 1; % YOUR FIELD NUMBER ie 1 to 8
fieldID2 = 3; % my case 1 Temp 2 Humid
readAPIKey = '19EJIJW6YBM7VS7N';
[data1, time1] = thingSpeakRead(readChannelID, 'Field',fieldID1,'NumDays',1,'ReadKey', readAPIKey);
[data2,time2] = thingSpeakRead(readChannelID, 'Field',fieldID2,'NumDays',1,'ReadKey', readAPIKey);
thingSpeakPlotYY(time1, data1, time2, data2,...
'YGrid1','on','YLabel1','% H.R.',...
'YLabel2','*C','XLabel','Fecha y hora',...
'Title','Tempix y Humix ultimas 24 horas');

However, an error occurs saying that the function thingSpeakPlotYY is unrecognized

Christopher Stapels
Christopher Stapels on 7 Jun 2021

That function (thingSpeakPlotYY) has been deprecated for some time. Can you let us know where you found the code? You can use yyaxis instead.

warda Nemouchi
warda Nemouchi on 8 Jun 2021

Yes, i found the link in youtube video: Here is the link of the code: https://www.mathworks.com/matlabcentral/fileexchange/71908-air-quality-measurements-and-visualizations?s_eid=PSM_15028

Christopher Stapels
Christopher Stapels on 8 Jun 2021

Thanks for sharing the file exchange post. I don't see thingSpeakPlotYY in that file exchange code. If you can find the you tube video, can you please share it?

warda Nemouchi
warda Nemouchi on 9 Jun 2021

Sorry, i have pasted the wrong link, Here is the right one : https://community.thingspeak.com/forum/thingspeak-apps/how-to-have-multiple-field-data-in-one-graph/

Christopher Stapels
Christopher Stapels on 9 Jun 2021

I really appreciate that! I have put off the work of culling posts in the old community, and this provides some inspiration. Let me know if you are able to get what you need working with yyaxis right.

warda Nemouchi
warda Nemouchi on 10 Jun 2021

Thank you, i have managed to do it using yyaxis. however i'm wondering if i can make the appearance of the generated graph as field graph appearance. Another question is how can i make the matlab visualisation in real-time.