{"id":378,"date":"2009-07-02T16:22:28","date_gmt":"2009-07-02T16:22:28","guid":{"rendered":"https:\/\/blogs.mathworks.com\/videos\/2009\/07\/02\/advanced-loading-files-using-their-names-for-variable-names\/"},"modified":"2009-07-02T16:22:28","modified_gmt":"2009-07-02T16:22:28","slug":"advanced-loading-files-using-their-names-for-variable-names","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/videos\/2009\/07\/02\/advanced-loading-files-using-their-names-for-variable-names\/","title":{"rendered":"Advanced: loading files using their names for variable names"},"content":{"rendered":"In this short video we will show how to bring text files into MATLAB and use the original file name as the variable name.  Actually, the file name will be used as a field name in a structure.\r\n\r\n<p><p>\r\n\r\nSome people would use the EVAL statement or ASSIGNIN to do this, however doing so would disallow the JIT accelerator from speeding the code up as much as it could.  The skills taught in this video are related to the ones in these videos:\r\n\r\n<p><p>\r\n\r\n<a href=\"https:\/\/blogs.mathworks.com\/videos\/2008\/09\/09\/advanced-matlab-file-name-processing-from-directory-listing\/\">Processing files in a directory with MATLAB<\/a>\r\n\r\n<p>\r\n\r\n<a href=\"https:\/\/blogs.mathworks.com\/videos\/2009\/02\/27\/dynamic-field-name-usage\/\">Dynamic field name usage in MATLAB<\/a>\r\n\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=\"3877437987001\" 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\/2009\/07\/02\/advanced-loading-files-using-their-names-for-variable-names\/?dir=autoplay\"><img decoding=\"async\" src=\"https:\/\/cf-images.us-east-1.prod.boltdns.net\/v1\/static\/62009828001\/1b199515-743b-4fd1-ba00-3fdd01006688\/1675ac19-a331-4c3a-8cc5-f2910ef9d688\/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:31<\/time><\/span>\n      <\/div>\n      <\/a><\/div><p>In this short video we will show how to bring text files into MATLAB and use the original file name as the variable name.  Actually, the file name will be used as a field name in a&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/videos\/2009\/07\/02\/advanced-loading-files-using-their-names-for-variable-names\/\">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,12],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/378"}],"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=378"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/posts\/378\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/media?parent=378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/categories?post=378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/videos\/wp-json\/wp\/v2\/tags?post=378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}