{"id":3784,"date":"2018-07-03T14:10:04","date_gmt":"2018-07-03T19:10:04","guid":{"rendered":"https:\/\/blogs.mathworks.com\/videos\/?p=3784"},"modified":"2019-05-29T10:30:50","modified_gmt":"2019-05-29T15:30:50","slug":"using-a-list-of-anonymous-functions-to-implement-a-set-of-checks-on-a-data-set","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/videos\/2018\/07\/03\/using-a-list-of-anonymous-functions-to-implement-a-set-of-checks-on-a-data-set\/","title":{"rendered":"Using a List of Anonymous Functions to Implement a Set of Checks on a Data Set"},"content":{"rendered":"I need to perform a number of checks on the values in a large table. Currently I implement the checks in code in a script. I find it can be cumbersome if I want enable or disable certain checks, as I need to comment out or use a <tt>if<\/tt>\/<tt>then<\/tt>. Looking at my checks, they appear all to be of a similar structure: element-wise operations on the columns of the table. So I thought I would try to implement the checks as a list of anonymous functions stored in a spreadsheet. This way I could easily enable\/disable with a column value.\r\n\r\nI get stuck for a while (between 22:35 and 31:00), where I think <tt>isempty<\/tt> operates element-wise on an array when it always operates on the entire array and returns a scalar. Also sound quality is reduced from there to the end.\r\n\r\nFeatures covered in this <a href=\"https:\/\/blogs.mathworks.com\/videos\/2015\/10\/29\/matlab-code-along-videos\/\">code-along<\/a> style video include:\r\n<ul>\r\n \t<li>Anonymous functions<\/li>\r\n \t<li><tt>regexp<\/tt>, <tt>cellfun<\/tt><\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<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=\"5804956860001\" 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>\r\n\r\nPlay the video in full screen mode for a better viewing experience.\u00a0","protected":false},"excerpt":{"rendered":"<div class=\"thumbnail thumbnail_asset asset_overlay video\"><a href=\"https:\/\/blogs.mathworks.com\/videos\/2018\/07\/03\/using-a-list-of-anonymous-functions-to-implement-a-set-of-checks-on-a-data-set\/?dir=autoplay\"><img decoding=\"async\" src=\"https:\/\/cf-images.us-east-1.prod.boltdns.net\/v1\/static\/62009828001\/51091180-cb50-466a-b1e0-befd863f3802\/9c8cd924-f7f2-4d37-9f83-822a8dad0280\/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\">40:29<\/time><\/span>\n      <\/div>\n      <\/a><\/div><p>I need to perform a number of checks on the values in a large table. Currently I implement the checks in code in a script. I find it can be cumbersome if I want enable or disable certain checks, as I... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/videos\/2018\/07\/03\/using-a-list-of-anonymous-functions-to-implement-a-set-of-checks-on-a-data-set\/\">read more >><\/a><\/p>","protected":false},"author":133,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/3784"}],"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\/133"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/comments?post=3784"}],"version-history":[{"count":8,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/3784\/revisions"}],"predecessor-version":[{"id":4273,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/3784\/revisions\/4273"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/media?parent=3784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/categories?post=3784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/tags?post=3784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}