{"id":7959,"date":"2016-11-18T09:00:03","date_gmt":"2016-11-18T14:00:03","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=7959"},"modified":"2016-10-21T10:29:22","modified_gmt":"2016-10-21T14:29:22","slug":"matlab-file-association-fix","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2016\/11\/18\/matlab-file-association-fix\/","title":{"rendered":"MATLAB File Association Fix"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\n   <introduction><\/p>\n<p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495\">Sean<\/a>&#8216;s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/51165-matlab-file-association-fix\">MATLAB File Association Fix<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/2631027\">Patrik Forss&eacute;n<\/a>.\n      <\/p>\n<p>   <\/introduction><\/p>\n<p>Have you ever gone to open a MATLAB file of any kind and it did not open in MATLAB?  The one I remember frequently from my<br \/>\n      days in tech support was <i>*.mat<\/i> files being opened in Microsoft Access because <i>*.mat<\/i> is also a &#8220;Microsoft Access Table&#8221;.  Seeing how there are almost 500 downloads in the last month, this seems to still be fairly common.\n   <\/p>\n<p>Well if you run into this issue, Patrik&#8217;s file will fix it for you.  It writes a Windows registry file with the file extensions<br \/>\n      used by MATLAB associated with the release of MATLAB you run it in.  It also provides instructions for backing up your old<br \/>\n      registry file and then running the new one.\n   <\/p>\n<p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/mainfileassociationfix\/files.png\"> <\/p>\n<p>One note is that there are two new file extensions:<\/p>\n<div>\n<ul>\n<li><i>*.mlx<\/i> for MATLAB <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/what-is-a-live-script-or-function.html\">Live Scripts<\/a>.\n         <\/li>\n<li><i>*.mlapp<\/i> for MATLAB <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/app-designer.html\">App Designer Apps<\/a>.\n         <\/li>\n<\/ul><\/div>\n<h3>Comments<a name=\"2\"><\/a><\/h3>\n<p>Give it a try and let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=7959#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/51165-matlab-file-association-fix#comments\">comment<\/a> for Patrik.\n   <\/p>\n<p><script language=\"JavaScript\">\n<!--\n\n    function grabCode_e32c2b2b8bbb425fb8ec5e86fd223e3a() {\n        \/\/ Remember the title so we can use it in the new page\n        title = document.title;\n\n        \/\/ Break up these strings so that their presence\n        \/\/ in the Javascript doesn't mess up the search for\n        \/\/ the MATLAB code.\n        t1='e32c2b2b8bbb425fb8ec5e86fd223e3a ' + '##### ' + 'SOURCE BEGIN' + ' #####';\n        t2='##### ' + 'SOURCE END' + ' #####' + ' e32c2b2b8bbb425fb8ec5e86fd223e3a';\n    \n        b=document.getElementsByTagName('body')[0];\n        i1=b.innerHTML.indexOf(t1)+t1.length;\n        i2=b.innerHTML.indexOf(t2);\n \n        code_string = b.innerHTML.substring(i1, i2);\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\n\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \n        \/\/ in the XML parser.\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\n        \/\/ doesn't go ahead and substitute the less-than character. \n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\n\n        author = 'Sean de Wolski';\n        copyright = 'Copyright 2016 The MathWorks, Inc.';\n\n        w = window.open();\n        d = w.document;\n        d.write('\n\n<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\n\n\\n');\n      \n      d.title = title + ' (MATLAB code)';\n      d.close();\n      }   \n      \n-->\n<\/script><\/p>\n<p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><a href=\"javascript:grabCode_e32c2b2b8bbb425fb8ec5e86fd223e3a()\"><span style=\"font-size: x-small;        font-style: italic;\">Get<br \/>\n            the MATLAB code<br \/>\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><\/p>\n<p>      Published with MATLAB&reg; R2016b<\/p>\n<\/div>\n<p><!--\ne32c2b2b8bbb425fb8ec5e86fd223e3a ##### SOURCE BEGIN #####\n%% MATLAB File Association Fix\n%\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495 Sean>'s pick this week is\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/51165-matlab-file-association-fix MATLAB File Association Fix> by\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/2631027 Patrik Forss\u00c3\u00a9n>.\n% \n\n%% \n% Have you ever gone to open a MATLAB file of any kind and it did not open\n% in MATLAB?  The one I remember frequently from my days in tech support was\n% _*.mat_ files being opened in Microsoft Access because _*.mat_ is also a\n% \"Microsoft Access Table\".  Seeing how there are almost 500 downloads in\n% the last month, this seems to still be fairly common.\n%\n% Well if you run into this issue, Patrik's file will fix it for you.  It\n% writes a Windows registry file with the file extensions used by MATLAB\n% associated with the release of MATLAB you run it in.  It also provides\n% instructions for backing up your old registry file and then running the\n% new one.\n%\n% <<files.png>>\n%\n% One note is that there are two new file extensions:\n% \n% * _*.mlx_ for MATLAB <https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/what-is-a-live-script-or-function.html Live Scripts>.\n% * _*.mlapp_ for MATLAB <https:\/\/www.mathworks.com\/help\/matlab\/app-designer.html App Designer Apps>.\n% \n\n%% Comments\n% \n% Give it a try and let us know what you think\n% <https:\/\/blogs.mathworks.com\/pick\/?p=7959#respond here> or leave a\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/51165-matlab-file-association-fix#comments\n% comment> for Patrik.\n##### SOURCE END ##### e32c2b2b8bbb425fb8ec5e86fd223e3a\n--><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/mainfileassociationfix\/files.png\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>Sean&#8216;s pick this week is MATLAB File Association Fix by Patrik Forss&eacute;n.<\/p>\n<p>Have you ever gone to open a MATLAB file of any kind and it did not open in MATLAB?  The one I&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2016\/11\/18\/matlab-file-association-fix\/\">read more >><\/a><\/p>\n","protected":false},"author":87,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/7959"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=7959"}],"version-history":[{"count":3,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/7959\/revisions"}],"predecessor-version":[{"id":7962,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/7959\/revisions\/7962"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=7959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=7959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=7959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}