{"id":1749,"date":"2016-03-25T15:09:34","date_gmt":"2016-03-25T19:09:34","guid":{"rendered":"https:\/\/blogs.mathworks.com\/iot\/?p=1749"},"modified":"2018-02-15T16:52:08","modified_gmt":"2018-02-15T21:52:08","slug":"explore-your-iot-data-with-thingspeak-and-matlab","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/iot\/2016\/03\/25\/explore-your-iot-data-with-thingspeak-and-matlab\/","title":{"rendered":"Explore your IoT data with ThingSpeak and MATLAB"},"content":{"rendered":"<p><a href=\"https:\/\/blogs.mathworks.com\/loren\/2016\/03\/23\/explore-your-iot-data-with-thingspeak-and-matlab\/\" target=\"_blank\">Loren Shure<\/a>, a blogger at MATLAB Central, has written a new <a href=\"https:\/\/blogs.mathworks.com\/loren\/2016\/03\/23\/explore-your-iot-data-with-thingspeak-and-matlab\/\" target=\"_blank\">blog post<\/a> about Eric Wetjen&#8217;s\u00a0<a href=\"https:\/\/www.mathworks.com\/\/matlabcentral\/fileexchange\/52456\" target=\"_blank\">Counting Cars and Analyzing Traffic<\/a> project. Eric uses a Raspberry Pi and webcam to capture traffic data outside of the MathWorks headquarters in Natick, MA. All of the traffic data is stored on a public ThingSpeak <a href=\"https:\/\/thingspeak.com\/channels\/38629\" target=\"_blank\">channel<\/a>, so you will be able to use it to learn data analysis with the built-in MATLAB Analysis and Visualizations apps in <a href=\"https:\/\/thingspeak.com\/apps\" target=\"_blank\">ThingSpeak<\/a>.<!--more--><\/p>\n<p><a href=\"https:\/\/blogs.mathworks.com\/loren\/2016\/03\/23\/explore-your-iot-data-with-thingspeak-and-matlab\/\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-1511 size-full\" src=\"https:\/\/blogs.mathworks.com\/iot\/wp-content\/blogs.dir\/15\/files\/2015\/09\/MATLAB_car_counting_display.png\" alt=\"MATLAB car counting display\" width=\"506\" height=\"143\" \/><\/a><\/p>\n<p>Loren explores the data using MATLAB Analysis and MATLAB Visualizations app built into <a href=\"https:\/\/thingspeak.com\/apps\" target=\"_blank\">ThingSpeak<\/a>.<\/p>\n<p style=\"text-align: center;\"><script type='text\/javascript'>  \nwindow.onload = document.write(\"<iframe width='450' height='360' marginwidth='0' marginheight='0' scrolling='auto' frameborder='0'  src='https:\/\/thingspeak.com\/apps\/matlab_visualizations\/21115' ><\/iframe> \"); \n <\/script><\/p>\n<h3>Offline Analysis: Analyzing Data stored on ThingSpeak<\/h3>\n<p>If you have desktop MATLAB, you can gain even more insights into our traffic data or any of your ThingSpeak Channels. You need to first import the data from ThingSpeak into desktop MATLAB. To simplify the retrieval of the data from ThingSpeak, we use the functions from the <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/52244-thingspeak-support-toolbox\">ThingSpeak Support Toolbox<\/a>, available on MATLAB Central File Exchange.<\/p>\n<pre class=\"prettyprint lang-matlab\">readChannelID = 38629;\r\nreadAPIKey = '8NPXB8G515OAD94Q';\r\n\r\n%% Read Data %%\r\n[data, time] = thingSpeakRead(readChannelID,'DateRange',[datetime('Mar 13, 2016'),datetime('Mar 14, 2016')],'ReadKey', readAPIKey);\r\n<\/pre>\n<p>[via\u00a0<a href=\"https:\/\/blogs.mathworks.com\/loren\/2016\/03\/23\/explore-your-iot-data-with-thingspeak-and-matlab\/\" target=\"_blank\">Loren on the Art of MATLAB<\/a>]<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/iot\/wp-content\/blogs.dir\/15\/files\/2015\/09\/MATLAB_car_counting_display.png\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>Loren Shure, a blogger at MATLAB Central, has written a new blog post about Eric Wetjen&#8217;s\u00a0Counting Cars and Analyzing Traffic project. Eric uses a Raspberry Pi and webcam to capture traffic&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/iot\/2016\/03\/25\/explore-your-iot-data-with-thingspeak-and-matlab\/\">read more >><\/a><\/p>\n","protected":false},"author":148,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[210,60,227,209,122,213],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/posts\/1749"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/users\/148"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/comments?post=1749"}],"version-history":[{"count":10,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/posts\/1749\/revisions"}],"predecessor-version":[{"id":2294,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/posts\/1749\/revisions\/2294"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/media?parent=1749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/categories?post=1749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/tags?post=1749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}