{"id":271,"date":"2008-05-05T12:14:58","date_gmt":"2008-05-05T17:14:58","guid":{"rendered":"https:\/\/blogs.mathworks.com\/videos\/2008\/05\/05\/advanced-matlab-timer-objects\/"},"modified":"2016-01-15T10:28:47","modified_gmt":"2016-01-15T15:28:47","slug":"advanced-matlab-timer-objects","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/videos\/2008\/05\/05\/advanced-matlab-timer-objects\/","title":{"rendered":"Advanced MATLAB: Timer objects"},"content":{"rendered":"Sometimes you want something to update in MATLAB on a regular schedule. Timer objects can do that for you. We first introduced this for test and measurement applications, but it has since been moved into base MATLAB.\r\n\r\nIn this simple example, we will create a timer object and have it fire a callback every second to output a random number to the command line.\r\n\r\nThere are a lot more useful things to do with timer objects, of course. What have you done with them? [<a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=2195\/#comment\">Comment here<\/a>]\r\n<div><div class=\"row\"><div class=\"col-xs-12 containing-block\"><div class=\"bc-outer-container add_margin_20\"><videoplayer><div class=\"video-js-container\"><video data-video-id=\"3877438035001\" data-video-category=\"blog\" data-autostart=\"false\" data-account=\"62009828001\" data-omniture-account=\"mathwgbl\" data-player=\"rJ9XCz2Sx\" data-embed=\"default\" id=\"mathworks-brightcove-player\" class=\"video-js\" controls><\/video><script src=\"\/\/players.brightcove.net\/62009828001\/rJ9XCz2Sx_default\/index.min.js\"><\/script><script>if (typeof(playerLoaded) === 'undefined') {var playerLoaded = false;}(function isVideojsDefined() {if (typeof(videojs) !== 'undefined') {videojs(\"mathworks-brightcove-player\").on('loadedmetadata', function() {playerLoaded = true;});} else {setTimeout(isVideojsDefined, 10);}})();<\/script><\/div><\/videoplayer><\/div><\/div><\/div><\/div>\r\n&nbsp;","protected":false},"excerpt":{"rendered":"<div class=\"thumbnail thumbnail_asset asset_overlay video\"><a href=\"https:\/\/blogs.mathworks.com\/videos\/2008\/05\/05\/advanced-matlab-timer-objects\/?dir=autoplay\"><img decoding=\"async\" src=\"https:\/\/cf-images.us-east-1.prod.boltdns.net\/v1\/static\/62009828001\/8aa291a8-12a1-4a20-8ad4-ab8409f890a0\/2808ce61-e6df-48f6-944a-2c991bda35dd\/1280x720\/match\/image.jpg\" onError=\"this.style.display ='none';\"\/>\n      <div class=\"overlay_container\">\n      <span class=\"icon-video icon_color_null\"><time class=\"video_length\">2:35<\/time><\/span>\n      <\/div>\n      <\/a><\/div><p>Sometimes you want something to update in MATLAB on a regular schedule. Timer objects can do that for you. We first introduced this for test and measurement applications, but it has since been moved&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/videos\/2008\/05\/05\/advanced-matlab-timer-objects\/\">read more >><\/a><\/p>","protected":false},"author":68,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[19,4,12],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/271"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/comments?post=271"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/271\/revisions"}],"predecessor-version":[{"id":1932,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/271\/revisions\/1932"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/media?parent=271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/categories?post=271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/tags?post=271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}