Phillip Maus in MATLAB Answers
上次活动时间: 2020-9-14

Hello, I want to plot two values from a thingspeak channel in a graph. If I don't use any optional value for LineSpec, I can't see anything plotted although I don't get an error message and the values on x and y axis are in the correct range. I f I ad for example a 'b.' (for blue points as markers) as LineSpec, I will see the markers but no line. If I ad an '-' for the solid line ('b.-' or 'b-') it doesn't show anything. This seems very strange to me. I just want a solid line. How can I fix this? Many thanks! This is my code: readChannelID = [1....4]; fieldID1 = [1]; fieldID2 = [2]; readAPIKey = 'OA9........MQ'; [data1, time1] = thingSpeakRead(readChannelID, 'Field', fieldID1, 'NumPoints', 600, 'ReadKey', readAPIKey); [data2, time2] = thingSpeakRead(readChannelID, 'Field', fieldID2, 'NumPoints', 600, 'ReadKey', readAPIKey); yyaxis left; plot(time1, data1,'r.') % nothing is plotted if I use just use plot(time1, data1) or if I use plot(time1, data1,'r-') yyaxis right; plot(time2, data2, 'b.');

关于 ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.