{"id":510,"date":"2011-09-09T16:28:49","date_gmt":"2011-09-09T16:28:49","guid":{"rendered":"https:\/\/blogs.mathworks.com\/videos\/2011\/09\/09\/starting-in-matlab-sub-functions\/"},"modified":"2012-03-28T15:10:21","modified_gmt":"2012-03-28T20:10:21","slug":"starting-in-matlab-sub-functions","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/videos\/2011\/09\/09\/starting-in-matlab-sub-functions\/","title":{"rendered":"Managing code in MATLAB: Sub functions"},"content":{"rendered":"This is the first series of MATLAB video tutorials that are an attempt to systematically make videos for a \u201ctechnology trees\u201d for using MATLAB. This first tree covers the various kinds of MATLAB files you might write. The tree shows you the order you should watch them because some rely on skills you need to learn from earlier videos, but some do not.\r\n<p>\r\n<div style=\"text-align:center; width:640px; margin-left:auto; margin-right:auto;\">\r\n<img id=\"Image-Maps_3201104211133568\" src='https:\/\/blogs.mathworks.com\/videos\/..\/images\/videos\/2011\/04\/tech-tree.jpg'  usemap=\"#Image-Maps_3201104211133568\" border=\"0\" width=\"640\" height=\"400\" alt=\"\" \/>\r\n<map id=\"_Image-Maps_3201104211133568\" name=\"Image-Maps_3201104211133568\">\r\n<area shape=\"rect\" coords=\"276,17,358,67\"     href=\"https:\/\/blogs.mathworks.com\/videos\/?p=501\" alt=\"Script\" title=\"Script\"    \/>\r\n<area shape=\"rect\" coords=\"277,96,359,146\"   href=\"https:\/\/blogs.mathworks.com\/videos\/?p=505\" alt=\"Function\" title=\"Function\"    \/>\r\n<area shape=\"rect\" coords=\"279,177,361,227\" href=\"https:\/\/blogs.mathworks.com\/videos\/?p=508\" alt=\"1in1out\" title=\"1in1out\"    \/>\r\n<area shape=\"rect\" coords=\"273,260,355,310\" href=\"https:\/\/blogs.mathworks.com\/videos\/?p=509\" alt=\"MinNout\" title=\"MinNout\"    \/>\r\n<area shape=\"rect\" coords=\"278,341,360,391\" href=\"https:\/\/blogs.mathworks.com\/videos\/?p=516\" alt=\"VarArg\" title=\"VarArg\"    \/>\r\n<area shape=\"rect\" coords=\"475,69,557,119\"   href=\"https:\/\/blogs.mathworks.com\/videos\/?p=512\" alt=\"Cell mode\" title=\"Cell mode\"    \/>\r\n<area shape=\"rect\" coords=\"409,153,491,203\" href=\"https:\/\/blogs.mathworks.com\/videos\/?p=513\" alt=\"Markup\" title=\"Markup\"    \/>\r\n<area shape=\"rect\" coords=\"540,152,622,202\" href=\"https:\/\/blogs.mathworks.com\/videos\/2011\/08\/19\/starting-in-matlab-cell-mode-interactive\/\" alt=\"Interactive\" title=\"Interactive\"    \/>\r\n<area shape=\"rect\" coords=\"20,178,102,228\"   href=\"https:\/\/blogs.mathworks.com\/videos\/?p=507\" alt=\"Driver script\" title=\"Driver script\"    \/>\r\n<area shape=\"rect\" coords=\"148,179,230,229\" href=\"https:\/\/blogs.mathworks.com\/videos\/?p=510\" alt=\"Sub function\" title=\"Sub function\"    \/>\r\n<area shape=\"rect\" coords=\"148,254,230,304\" href=\"https:\/\/blogs.mathworks.com\/videos\/?p=511\" alt=\"Nested\" title=\"Nested\"    \/>\r\n<\/map>\r\n<\/div>\r\n<p>\r\nThis MATLAB tutorial video will show you how to make subfunctions in MATLAB.  This allows you to have functions that are available only to other functions in the same file.  This is ideal when you have subroutines that are only likely to be useful to the other functions in that file.\r\n<p>\r\n\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=\"3877437012001\" 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 <\/div>\r\n","protected":false},"excerpt":{"rendered":"<div class=\"thumbnail thumbnail_asset asset_overlay video\"><a href=\"https:\/\/blogs.mathworks.com\/videos\/2011\/09\/09\/starting-in-matlab-sub-functions\/?dir=autoplay\"><img decoding=\"async\" src=\"https:\/\/cf-images.us-east-1.prod.boltdns.net\/v1\/static\/62009828001\/4d5c9f5f-cb0e-4d1c-abf3-cf8bf028c531\/84dabaa8-ff18-4e41-85a6-394e3cb34cad\/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\">1:50<\/time><\/span>\n      <\/div>\n      <\/a><\/div><p>This is the first series of MATLAB video tutorials that are an attempt to systematically make videos for a \u201ctechnology trees\u201d for using MATLAB. This first tree covers the various kinds of MATLAB&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/videos\/2011\/09\/09\/starting-in-matlab-sub-functions\/\">read more >><\/a><\/p>","protected":false},"author":68,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,17],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/510"}],"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=510"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/510\/revisions"}],"predecessor-version":[{"id":685,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/510\/revisions\/685"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/media?parent=510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/categories?post=510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/tags?post=510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}