{"id":6727,"date":"2020-10-13T14:28:54","date_gmt":"2020-10-13T05:58:54","guid":{"rendered":"https:\/\/people.utm.my\/razman-ayop\/?p=6727"},"modified":"2020-10-13T14:29:15","modified_gmt":"2020-10-13T05:59:15","slug":"associate-matlab-file","status":"publish","type":"post","link":"https:\/\/people.utm.my\/razman-ayop\/associate-matlab-file\/","title":{"rendered":"Associate Matlab File"},"content":{"rendered":"<a href='https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/51165-matlab-file-association-fix' class='small-button smallsilver' target=\"_blank\">Download<\/a>\n<p><strong>Save this code below as .m file<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>function associateFiles(action, userExtList, fileStr)<\/p>\n<p>&nbsp;<\/p>\n<p>% associateFiles(action, extList, fileStr)<\/p>\n<p>%<\/p>\n<p>% Makes a registry files that can be used to set correct file associantions on<\/p>\n<p>% a windows platform. The following MATLAB file extensions are supported:<\/p>\n<p>% .m, .mat, .fig, .mexw32, .mexw64, .p, .mdl, .mdlp, .slx, .mldatx, .req,<\/p>\n<p>% .sldd, .slddc, .slxp, .sltx, .mn, .mu, .muphlp, .xvc, .xvz, .ssc, .mlapp,<\/p>\n<p>% .mlappinstall, .mltbx, .mlpkginstall, .mlprj<\/p>\n<p>%<\/p>\n<p>% INPUT:<\/p>\n<p>% action\u00a0 &#8211; optional string.<\/p>\n<p>%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 * &#8216;add&#8217; (default) adds\/rewrites the MATLAB file association registry<\/p>\n<p>%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 keys for this version.<\/p>\n<p>%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 * &#8216;delete&#8217; deletes the MATLAB file association registry entries for<\/p>\n<p>%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ALL versions of MATLAB (including &#8220;old style&#8221; ones)<\/p>\n<p>%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 * &#8216;deleteadd&#8217; is the same as &#8216;delete&#8217; followed by &#8216;add&#8217;<\/p>\n<p>% extList &#8211; optional string or cell array of strings containing the file<\/p>\n<p>%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 extensions that should be associated with this version. Default is<\/p>\n<p>%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 all MATLAB file extension (see above).<\/p>\n<p>% fileStr &#8211; optional string with the name of the registry file to be written<\/p>\n<p>%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (possibly including path). Default is the file<\/p>\n<p>%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216;MatlabFileAssocFix.reg&#8217; in the current directory.<\/p>\n<p>%<\/p>\n<p>% USAGE:<\/p>\n<p>% 1) Run with desired options (see above). A registry file should have been<\/p>\n<p>%\u00a0\u00a0\u00a0 created.<\/p>\n<p>% 2) Exit all running instances of MATLAB.<\/p>\n<p>% 3) Make a backup copy of the windows registry if you need to restore the<\/p>\n<p>%\u00a0\u00a0\u00a0 changes, see <a href=\"https:\/\/support.microsoft.com\/en-us\/kb\/322756\">https:\/\/support.microsoft.com\/en-us\/kb\/322756<\/a><\/p>\n<p>% 4) Double click on the created file (possibly need to enter a password) and<\/p>\n<p>%\u00a0\u00a0\u00a0 confirm.<\/p>\n<p>% 5) Restart Windows (or explorer.exe).<\/p>\n<p>% 6) The MATLAB files should now be associated with the MATLAB version that the<\/p>\n<p>%\u00a0\u00a0\u00a0 registry file was created in and e.g. m-files should be opened in an<\/p>\n<p>%\u00a0\u00a0\u00a0 already running instance of MATLAB.<\/p>\n<p>%<\/p>\n<p>% EXAMPLES:<\/p>\n<p>% * associateFiles(&#8216;deleteadd&#8217;) &#8211; Makes a registry files that deletes all<\/p>\n<p>%\u00a0\u00a0 previous MATLAB file association registry keys and write new ones that<\/p>\n<p>%\u00a0\u00a0 associates all MATLAB files with the MATLAB version that the registry file<\/p>\n<p>%\u00a0\u00a0 was created in.<\/p>\n<p>% * associateFiles(&#8221;, {&#8216;.m&#8217;, &#8216;.mat&#8217;, &#8216;.fig&#8217;}, &#8216;myFile&#8217;) &#8211; Makes a registry file<\/p>\n<p>%\u00a0\u00a0 &#8220;myFile.reg&#8221; that associates m-, mat- and fig-files with the MATLAB version<\/p>\n<p>%\u00a0\u00a0 that the registry file was created in.<\/p>\n<p>%<\/p>\n<p>% VERSION 1.0<\/p>\n<p>&nbsp;<\/p>\n<p>% Defualt input<\/p>\n<p>if (nargin &lt; 1 || isempty(action))<\/p>\n<p>action\u00a0\u00a0\u00a0\u00a0\u00a0 = &#8216;add&#8217;;<\/p>\n<p>end<\/p>\n<p>if (nargin &lt; 2)<\/p>\n<p>userExtList = {};<\/p>\n<p>end<\/p>\n<p>if (nargin &lt; 3)<\/p>\n<p>fileStr = &#8221;;<\/p>\n<p>end<\/p>\n<p>if (~iscell(userExtList))<\/p>\n<p>if (isempty(userExtList))<\/p>\n<p>userExtList = {};<\/p>\n<p>else<\/p>\n<p>userExtList = {userExtList};<\/p>\n<p>end<\/p>\n<p>end<\/p>\n<p>&nbsp;<\/p>\n<p>% Sanity check<\/p>\n<p>if (~ischar(action) || (~strcmpi(action, &#8216;add&#8217;) &amp;&amp; &#8230;<\/p>\n<p>~strcmpi(action, &#8216;delete&#8217;) &amp;&amp; ~strcmpi(action, &#8216;deleteadd&#8217;)))<\/p>\n<p>error(&#8216;The action to perform must be &#8221;add&#8221;, &#8221;delete&#8221; or &#8221;deleteadd&#8221;!&#8217;)<\/p>\n<p>end<\/p>\n<p>if (~isempty(userExtList) &amp;&amp; ~min(cellfun(@ischar, userExtList)))<\/p>\n<p>error(&#8216;The file extension list must be a string or a cell array of strings!&#8217;)<\/p>\n<p>end<\/p>\n<p>if (~ischar(fileStr))<\/p>\n<p>error(&#8216;The file to write to must be a string!&#8217;)<\/p>\n<p>end<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>% Get the currently running MATLAB version<\/p>\n<p>verStr = regexp(version, &#8216;(\\d*?\\.\\d*?\\.\\d*?)\\.&#8217;, &#8216;tokens&#8217;);<\/p>\n<p>verStr = verStr{1}{1};<\/p>\n<p>verNum = str2double(regexprep(verStr, &#8216;(\\d*?\\.\\d*)[\\x0000-\\xffff]*&#8217;, &#8216;$1&#8217;));<\/p>\n<p>verHex = sprintf(&#8216;%04x&#8217;, str2double(regexprep(verStr, &#8230;<\/p>\n<p>&#8216;(\\d*?)\\.[\\x0000-\\xffff]*&#8217;, &#8216;$1&#8217;)), str2double(regexprep(verStr, &#8230;<\/p>\n<p>&#8216;\\d*?\\.(\\d*?)\\.[\\x0000-\\xffff]*&#8217;, &#8216;$1&#8217;)));<\/p>\n<p>&nbsp;<\/p>\n<p>% Get 32\/64-bit<\/p>\n<p>arch = computer;<\/p>\n<p>switch arch<\/p>\n<p>case &#8216;PCWIN&#8217;<\/p>\n<p>binFolder = &#8216;win32&#8217;;<\/p>\n<p>case &#8216;PCWIN64&#8217;<\/p>\n<p>binFolder = &#8216;win64&#8217;;<\/p>\n<p>end<\/p>\n<p>binPath = fullfile(matlabroot, &#8216;bin&#8217;, binFolder);<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>% Known MATLAB files with possible DDE actions<\/p>\n<p>fileExtCell = {&#8230;<\/p>\n<p>&#8216;fig&#8217; ,\u00a0\u00a0 &#8216;MATLAB Figure&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;-62&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>{&#8216;Open&#8217;, &#8216;uiopen(&#8221;%1&#8221;,1)&#8217;}\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , []\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;m&#8217;\u00a0\u00a0\u00a0\u00a0 , &#8216;MATLAB Code&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;-58&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>{&#8216;Open&#8217;, &#8216;uiopen(&#8221;%1&#8221;,1)&#8217;}\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , {&#8216;Run&#8217;, &#8216;run(&#8221;%1&#8221;)&#8217;}\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;mat&#8217;\u00a0\u00a0 , &#8216;MATLAB Data&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;-59&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>{&#8216;Load&#8217;, &#8216;load(&#8221;%1&#8221;)&#8217;\u00a0\u00a0\u00a0 }\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , {&#8216;Open&#8217;, &#8216;uiimport(&#8221;%1&#8221;)&#8217;}; &#8230;<\/p>\n<p>&#8216;mdl&#8217;\u00a0\u00a0 , &#8216;Simulink Model&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;-61&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>{&#8216;Load&#8217;, &#8216;uiopen(&#8221;%1&#8221;,1)&#8217;}\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , []\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;mdlp&#8217;\u00a0 , &#8216;Simulink Protected Model&#8217;\u00a0\u00a0 , &#8216;-72&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>[]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , []\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;mexw32&#8217;, &#8216;MATLAB MEX&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;-63&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>[]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , []\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;mexw64&#8217;, &#8216;MATLAB MEX&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;-63&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>[]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , []\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;mn&#8217;\u00a0\u00a0\u00a0 , &#8216;MuPAD Notebook&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;-66&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>{&#8216;Open&#8217;, &#8216;mupad(&#8221;%1&#8221;)&#8217;}\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , []\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;mu&#8217;\u00a0\u00a0\u00a0 , &#8216;MuPAD Code&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;-67&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>{&#8216;Open&#8217;, &#8216;uiopen(&#8221;%1&#8221;,1)&#8217;}\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , []\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;muphlp&#8217;, &#8216;MuPAD Help&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;-68&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>{&#8216;Open&#8217;, &#8216;doc(symengine, &#8221;%1&#8221;)&#8217;}\u00a0\u00a0\u00a0\u00a0 , []\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;p&#8217;\u00a0\u00a0\u00a0\u00a0 , &#8216;MATLAB P-code&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;-60&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>[]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , []\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;slx&#8217;\u00a0\u00a0 , &#8216;Simulink Model (SLX format)&#8217;, &#8216;-73&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>{&#8216;Open&#8217;, &#8216;uiopen(&#8221;%1&#8221;,1)&#8217;}\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , []\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;ssc&#8217;\u00a0\u00a0 , &#8216;Simscape Model&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;-65&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>{&#8216;Open&#8217;, &#8216;uiopen(&#8221;%1&#8221;,1)&#8217;}\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , []\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;xvc&#8217;\u00a0\u00a0 , &#8216;MuPAD Graphics&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;-69&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>{&#8216;Open&#8217;, &#8216;mupad(&#8221;%1&#8221;)&#8217;}\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , []\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;xvz&#8217;\u00a0\u00a0 , &#8216;MuPAD Graphics&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;-70&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8230;<\/p>\n<p>{&#8216;Open&#8217;, &#8216;mupad(&#8221;%1&#8221;)&#8217;}\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , []\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;mlapp&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;MATLAB Application&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , [] , [], []\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;mltbx&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;MATLAB Toolbox&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , [] , [], []\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;mldatx&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;Simulink Scenario&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , [] , [], []\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;req&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;Simulink Requirements Link&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0 , [] , [], []\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;sldd&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;Simulink Dictionary&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , [] , [], []\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;slddc&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;Simulink Dictionary&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , [] , [], []\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;mlappinstall&#8217;, &#8216;MATLAB Application&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , [] , [], []\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;mlpkginstall&#8217;, &#8216;MATLAB Support Package&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , [] , [], []\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;slxp&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;Simulink Protected Model Package&#8217;, [] , [], []\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;sltx&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;Simulink Template&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , [] , [], []\u00a0\u00a0\u00a0\u00a0\u00a0 ; &#8230;<\/p>\n<p>&#8216;mlprj&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , &#8216;MATLAB Project&#8217;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 , [] , [], []};<\/p>\n<p>&nbsp;<\/p>\n<p>% Possibly trim list<\/p>\n<p>if (~isempty(userExtList))<\/p>\n<p>fileExtCell = fileExtCell(ismember(fileExtCell(:, 1), &#8230;<\/p>\n<p>regexprep(userExtList, &#8216;\\.&#8217;, &#8221;)), :);<\/p>\n<p>end<\/p>\n<p>&nbsp;<\/p>\n<p>% Make registry file<\/p>\n<p>if (~isempty(fileStr))<\/p>\n<p>% Possibly add file extension<\/p>\n<p>[~, ~, tmp] = fileparts(fileStr);<\/p>\n<p>if (isempty(tmp))<\/p>\n<p>fileStr = [fileStr, &#8216;.reg&#8217;];<\/p>\n<p>end<\/p>\n<p>fid = fopen(fileStr, &#8216;w&#8217;);<\/p>\n<p>else<\/p>\n<p>fid = fopen(&#8216;MatlabFileAssocFix.reg&#8217;, &#8216;w&#8217;);<\/p>\n<p>end<\/p>\n<p>if (fid == -1)<\/p>\n<p>error(&#8216;Failed to create registry file&#8217;)<\/p>\n<p>end<\/p>\n<p>% Write intial lines<\/p>\n<p>fprintf(fid, &#8216;%s\\r\\n\\r\\n&#8217;, &#8216;Windows Registry Editor Version 5.00&#8217;);<\/p>\n<p>fprintf(fid, &#8216;%s\\r\\n\\r\\n&#8217;, &#8216;;FIXES MATLAB FILE ASSOCIATIONS&#8217;);<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>% REMOVE OLD KEYS<\/p>\n<p>explorerKey = [&#8216;HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\&#8217;, &#8230;<\/p>\n<p>&#8216;CurrentVersion\\Explorer\\FileExts&#8217;];<\/p>\n<p>% Iterate over file extensions<\/p>\n<p>for fileExtNo = 1 : size(fileExtCell, 1)<\/p>\n<p>rmKeys\u00a0 = {};<\/p>\n<p>fileExt = fileExtCell{fileExtNo, 1};<\/p>\n<p>&nbsp;<\/p>\n<p>% File extension keys<\/p>\n<p>[status, result] = dos([&#8216;reg query HKEY_CLASSES_ROOT \/f .&#8217;, fileExt, &#8230;<\/p>\n<p>&#8216; \/k \/e&#8217;]);<\/p>\n<p>if (~status)<\/p>\n<p>keys = regexp(result, &#8216;(HKEY_CLASSES_ROOT[\\x0000-\\xffff]*?)\\n&#8217;, &#8216;tokens&#8217;);<\/p>\n<p>rmKeys = [rmKeys, keys{:}];<\/p>\n<p>end<\/p>\n<p>&nbsp;<\/p>\n<p>% Old style keys without version numbers<\/p>\n<p>if (~strcmpi(fileExt, &#8216;mexw64&#8217;))<\/p>\n<p>% Uses single DDE key for mex files<\/p>\n<p>if (strcmpi(fileExt, &#8216;mexw32&#8217;))<\/p>\n<p>fileExtTmp = &#8216;mex&#8217;;<\/p>\n<p>else<\/p>\n<p>fileExtTmp = fileExt;<\/p>\n<p>end<\/p>\n<p>[status, result] = dos([&#8216;reg query HKEY_CLASSES_ROOT \/f &#8216;, &#8230;<\/p>\n<p>fileExtTmp, &#8216;file \/k \/e&#8217;]);<\/p>\n<p>if (~status)<\/p>\n<p>keys = regexp(result, &#8216;(HKEY_CLASSES_ROOT[\\x0000-\\xffff]*?)\\n&#8217;, &#8230;<\/p>\n<p>&#8216;tokens&#8217;);<\/p>\n<p>rmKeys = [rmKeys, keys{:}];<\/p>\n<p>end<\/p>\n<p>end<\/p>\n<p>&nbsp;<\/p>\n<p>% New style keys with version number<\/p>\n<p>if (strcmpi(action, &#8216;add&#8217;))<\/p>\n<p>% Only remove keys related to this version<\/p>\n<p>[status, result] = dos([&#8216;reg query HKEY_CLASSES_ROOT \/f MATLAB.&#8217;, &#8230;<\/p>\n<p>fileExt, &#8216;.&#8217;, verStr &#8216; \/k&#8217;]);<\/p>\n<p>else<\/p>\n<p>% Remove keys related to ALL version<\/p>\n<p>[status, result] = dos([&#8216;reg query HKEY_CLASSES_ROOT \/f MATLAB.&#8217;, &#8230;<\/p>\n<p>fileExt, &#8216;. \/k&#8217;]);<\/p>\n<p>end<\/p>\n<p>if (~status)<\/p>\n<p>keys = regexp(result, &#8216;(HKEY_CLASSES_ROOT[\\x0000-\\xffff]*?)\\n&#8217;, &#8216;tokens&#8217;);<\/p>\n<p>rmKeys = [rmKeys, keys{:}];<\/p>\n<p>end<\/p>\n<p>&nbsp;<\/p>\n<p>% Explorer keys<\/p>\n<p>[status, result] = dos([&#8216;reg query &#8216;, explorerKey, &#8216; \/f .&#8217;, fileExt, &#8230;<\/p>\n<p>&#8216; \/k \/e&#8217;]);<\/p>\n<p>if (~status)<\/p>\n<p>keys = regexp(result, &#8216;(HKEY_CURRENT_USER[\\x0000-\\xffff]*?)\\n&#8217;, &#8216;tokens&#8217;);<\/p>\n<p>rmKeys = [rmKeys, keys{:}];<\/p>\n<p>end<\/p>\n<p>&nbsp;<\/p>\n<p>% Write to file<\/p>\n<p>if (~isempty(rmKeys))<\/p>\n<p>fprintf(fid, &#8216;%s\\r\\n\\r\\n&#8217;, [&#8216;;REMOVES &#8216;, upper(fileExt), &#8230;<\/p>\n<p>&#8216; FILE ASSOCIATIONS&#8217;]);<\/p>\n<p>for keyNo = 1 : length(rmKeys)<\/p>\n<p>key = rmKeys{keyNo};<\/p>\n<p>fprintf(fid, &#8216;%s\\r\\n\\r\\n&#8217;, [&#8216;[-&#8216;, key, &#8216;]&#8217;]);<\/p>\n<p>end<\/p>\n<p>end<\/p>\n<p>end<\/p>\n<p>&nbsp;<\/p>\n<p>% ADD KEYS<\/p>\n<p>if (~strcmpi(action, &#8216;delete&#8217;))<\/p>\n<p>% Get text Persistent Handler<\/p>\n<p>[status, result] = dos(&#8230;<\/p>\n<p>&#8216;reg query HKEY_CLASSES_ROOT\\.txt\\PersistentHandler \/ve&#8217;);<\/p>\n<p>if (~status)<\/p>\n<p>PersistentHandler = regexp(result, &#8216;\\{[\\x0000-\\xffff]*?\\}&#8217;, &#8216;match&#8217;);<\/p>\n<p>PersistentHandler = PersistentHandler{1};<\/p>\n<p>else<\/p>\n<p>PersistentHandler = &#8221;;<\/p>\n<p>end<\/p>\n<p>% DDE call<\/p>\n<p>ddeCall = &#8216;ShellVerbs.Matlab&#8217;;<\/p>\n<p>if (verNum &gt; 8)<\/p>\n<p>% Changed from R2013a<\/p>\n<p>ddeCall = [ddeCall, &#8216;.&#8217;, verStr];<\/p>\n<p>end<\/p>\n<p>% Default icon<\/p>\n<p>defIcon = &#8216;m&#8217;;<\/p>\n<p>if (~exist(fullfile(binPath, &#8216;m.ico&#8217;), &#8216;file&#8217;))<\/p>\n<p>defIcon = &#8221;;<\/p>\n<p>end<\/p>\n<p>% Path to MATLAB binary directory with <a href=\"http:\/\/\">\\\\<\/a><\/p>\n<p>binPathStr = regexprep(binPath, &#8216;<a href=\"http:\/\/\">\\\\<\/a>&#8216;, &#8216;\\\\\\\\&#8217;);<\/p>\n<p>&nbsp;<\/p>\n<p>% Write Shell Open key<\/p>\n<p>key = [&#8216;[HKEY_CLASSES_ROOT\\Applications\\MATLAB.exe\\shell\\open&#8217;, &#8230;<\/p>\n<p>&#8216;\\command]%r&#8217;, &#8216;@=&#8221;\\&#8221;&#8216;, binPathStr, &#8216;\\\\MATLAB.exe\\&#8221; \\&#8221;%1\\&#8221;&#8221;%r%r&#8217;];<\/p>\n<p>fprintf(fid, &#8216;%s\\r\\n\\r\\n&#8217;, &#8216;;ADD SHELL OPEN&#8217;);<\/p>\n<p>lines = regexp(key, &#8216;([\\x0000-\\xffff]*?)%r&#8217;, &#8216;tokens&#8217;);<\/p>\n<p>for lineNo = 1 : length(lines)<\/p>\n<p>fprintf(fid, &#8216;%s\\r\\n&#8217;, lines{lineNo}{1});<\/p>\n<p>end<\/p>\n<p>&nbsp;<\/p>\n<p>% Iterate over file types<\/p>\n<p>for fileExtNo = 1 : size(fileExtCell, 1)<\/p>\n<p>fileExt = fileExtCell{fileExtNo, 1};<\/p>\n<p>&nbsp;<\/p>\n<p>% File extension keys<\/p>\n<p>key\u00a0 = [&#8216;[HKEY_CLASSES_ROOT\\.&#8217;, fileExt, &#8216;]%r@=&#8221;MATLAB.&#8217;, fileExt, &#8216;.&#8217;, &#8230;<\/p>\n<p>verStr, &#8216;&#8221;%r&#8217;];<\/p>\n<p>if (strcmpi(fileExt, &#8216;m&#8217;) &amp;&amp; ~isempty(PersistentHandler))<\/p>\n<p>% Add some values<\/p>\n<p>key = [key, &#8216;&#8221;Content Type&#8221;=&#8221;text\/plain&#8221;%r&#8217;, &#8230;<\/p>\n<p>&#8216;&#8221;PerceivedType&#8221;=&#8221;Text&#8221;%r&#8217;];<\/p>\n<p>end<\/p>\n<p>key = [key, &#8216;%r&#8217;];<\/p>\n<p>key = [key, &#8216;[HKEY_CLASSES_ROOT\\.&#8217;, fileExt, &#8230;<\/p>\n<p>&#8216;\\OpenWithProgids]%r&#8221;MATLAB.&#8217;, fileExt, &#8216;.&#8217;, verStr, &#8216;&#8221;=&#8221;&#8221;%r%r&#8217;];<\/p>\n<p>if (strcmpi(fileExt, &#8216;m&#8217;) &amp;&amp; ~isempty(PersistentHandler))<\/p>\n<p>key = [key, &#8216;[HKEY_CLASSES_ROOT\\.&#8217;, fileExt, &#8230;<\/p>\n<p>&#8216;\\PersistentHandler]%r@=&#8221;&#8216;, PersistentHandler, &#8216;&#8221;%r%r&#8217;];<\/p>\n<p>end<\/p>\n<p>key\u00a0 = [key, &#8216;[HKEY_CLASSES_ROOT\\.&#8217;, fileExt, &#8230;<\/p>\n<p>&#8216;\\Versions\\MATLAB.&#8217;, fileExt, &#8216;.&#8217; verStr, &#8216;]%r&#8221;FileVersionMS&#8221;=dword:&#8217;, &#8230;<\/p>\n<p>verHex, &#8216;%r&#8221;FileVersionLS&#8221;=dword:00000000%r%r&#8217;];<\/p>\n<p>&nbsp;<\/p>\n<p>% DDE keys<\/p>\n<p>ddeData = fileExtCell(ismember(fileExtCell(:, 1), fileExt), :);<\/p>\n<p>key = [key, &#8216;[HKEY_CLASSES_ROOT\\MATLAB.&#8217;, fileExt, &#8216;.&#8217; verStr, &#8230;<\/p>\n<p>&#8216;]%r@=&#8221;&#8216;, ddeData{2}, &#8216;&#8221;%r&#8217;];<\/p>\n<p>if (~isempty(ddeData{3}))<\/p>\n<p>key = [key, &#8216;&#8221;FriendlyTypeName&#8221;=&#8221;@&#8217;, binPathStr, &#8216;\\\\matlab.exe&#8217;, &#8230;<\/p>\n<p>&#8216;,&#8217;, ddeData{3}, &#8216;&#8221;%r&#8217;];<\/p>\n<p>end<\/p>\n<p>key = [key, &#8216;%r&#8217;];<\/p>\n<p>% Icon<\/p>\n<p>icon = fileExt;<\/p>\n<p>if (~exist(fullfile(binPath, [icon, &#8216;.ico&#8217;]), &#8216;file&#8217;))<\/p>\n<p>icon = defIcon;<\/p>\n<p>end<\/p>\n<p>if (~isempty(icon))<\/p>\n<p>key = [key, &#8216;[HKEY_CLASSES_ROOT\\MATLAB.&#8217;, fileExt, &#8216;.&#8217; verStr, &#8230;<\/p>\n<p>&#8216;\\DefaultIcon]%r@=&#8221;&#8216;, binPathStr, &#8216;<a href=\"http:\/\/\">\\\\<\/a>&#8216;, icon, &#8216;.ico,0&#8243;%r%r&#8217;];<\/p>\n<p>end<\/p>\n<p>% Shell actions<\/p>\n<p>for shellActionNo = 4:5<\/p>\n<p>ddePar = ddeData{shellActionNo};<\/p>\n<p>if (~isempty(ddePar))<\/p>\n<p>key = [key, &#8216;[HKEY_CLASSES_ROOT\\MATLAB.&#8217;, fileExt, &#8216;.&#8217; verStr, &#8230;<\/p>\n<p>&#8216;\\Shell\\&#8217;, ddePar{1}, &#8216;]%r@=&#8221;&#8216;, ddePar{1}, &#8216;&#8221;%r%r&#8217;];<\/p>\n<p>key = [key, &#8216;[HKEY_CLASSES_ROOT\\MATLAB.&#8217;, fileExt, &#8216;.&#8217; verStr, &#8230;<\/p>\n<p>&#8216;\\Shell\\&#8217;, ddePar{1}, &#8216;\\command]%r@=&#8221;\\&#8221;&#8216;, binPathStr, &#8230;<\/p>\n<p>&#8216;\\\\matlab.exe\\&#8221;&#8221;%r%r&#8217;];<\/p>\n<p>key = [key, &#8216;[HKEY_CLASSES_ROOT\\MATLAB.&#8217;, fileExt, &#8216;.&#8217; verStr, &#8230;<\/p>\n<p>&#8216;\\Shell\\&#8217;, ddePar{1}, &#8216;\\ddeexec]%r@=&#8221;&#8216;, ddePar{2}, &#8216;&#8221;%r%r&#8217;];<\/p>\n<p>key = [key, &#8216;[HKEY_CLASSES_ROOT\\MATLAB.&#8217;, fileExt, &#8216;.&#8217; verStr, &#8230;<\/p>\n<p>&#8216;\\Shell\\&#8217;, ddePar{1},&#8217;\\ddeexec\\application]%r@=&#8221;&#8216;, &#8230;<\/p>\n<p>ddeCall, &#8216;&#8221;%r%r&#8217;];<\/p>\n<p>key = [key, &#8216;[HKEY_CLASSES_ROOT\\MATLAB.&#8217;, fileExt, &#8216;.&#8217; verStr, &#8230;<\/p>\n<p>&#8216;\\Shell\\&#8217;, ddePar{1},&#8217;\\ddeexec\\topic]%r@=&#8221;system&#8221;%r%r&#8217;];<\/p>\n<p>end<\/p>\n<p>end<\/p>\n<p>&nbsp;<\/p>\n<p>% Explorer keys<\/p>\n<p>key = [key, &#8216;[&#8216;, explorerKey, &#8216;\\.&#8217;, fileExt, &#8216;\\OpenWithProgids]%r&#8217;];<\/p>\n<p>if (strcmpi(fileExt, &#8216;m&#8217;))<\/p>\n<p>key = [key, &#8216;&#8221;m_auto_file&#8221;=hex(0):%r&#8217;];<\/p>\n<p>end<\/p>\n<p>key = [key, &#8216;&#8221;MATLAB.&#8217;, fileExt, &#8216;.&#8217;,\u00a0 verStr, &#8216;&#8221;=hex(0):%r%r&#8217;];<\/p>\n<p>if (~isempty(ddeData{4}))<\/p>\n<p>% Add key<\/p>\n<p>key = [key, &#8216;[&#8216;, explorerKey, &#8216;\\.&#8217;, fileExt, &#8230;<\/p>\n<p>&#8216;\\OpenWithList]%r&#8221;a&#8221;=&#8221;MATLAB.exe&#8221;%r&#8221;MRUList&#8221;=&#8221;a&#8221;%r%r&#8217;];<\/p>\n<p>else<\/p>\n<p>key = [key, &#8216;[&#8216;, explorerKey, &#8216;\\.&#8217;, fileExt, &#8216;\\OpenWithList]%r%r&#8217;];<\/p>\n<p>end<\/p>\n<p>% Write to file<\/p>\n<p>fprintf(fid, &#8216;%s\\r\\n\\r\\n&#8217;, [&#8216;;ADD &#8216;, upper(fileExt), &#8230;<\/p>\n<p>&#8216; FILE ASSOCIATIONS&#8217;]);<\/p>\n<p>lines = regexp(key, &#8216;([\\x0000-\\xffff]*?)%r&#8217;, &#8216;tokens&#8217;);<\/p>\n<p>for lineNo = 1 : length(lines)<\/p>\n<p>fprintf(fid, &#8216;%s\\r\\n&#8217;, lines{lineNo}{1});<\/p>\n<p>end<\/p>\n<p>end<\/p>\n<p>&nbsp;<\/p>\n<p>end<\/p>\n<p>&nbsp;<\/p>\n<p>% Cloese file<\/p>\n<p>fclose(fid);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Save this code below as .m file &nbsp; &nbsp; &nbsp; function associateFiles(action, userExtList, fileStr) &nbsp; % associateFiles(action, extList, fileStr) % % Makes a registry files that can be used to set correct file associantions on % a windows platform. The following MATLAB file extensions are supported: % .m, .mat, .fig, .mexw32, .mexw64, .p, .mdl, .mdlp, [&hellip;]<\/p>\n","protected":false},"author":24954,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[32],"tags":[],"class_list":["post-6727","post","type-post","status-publish","format-standard","hentry","category-research-guidance"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/posts\/6727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/users\/24954"}],"replies":[{"embeddable":true,"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/comments?post=6727"}],"version-history":[{"count":2,"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/posts\/6727\/revisions"}],"predecessor-version":[{"id":6729,"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/posts\/6727\/revisions\/6729"}],"wp:attachment":[{"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/media?parent=6727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/categories?post=6727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/people.utm.my\/razman-ayop\/wp-json\/wp\/v2\/tags?post=6727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}