Using the green version of MATLAB cannot automatically associate the. m file, the solution found on the web is to run the following command in MATLAB:
Cwd=PWD;CD ([Matlabroot'\toolbox\matlab\winfun\private']); FILEASSOC ('Add',{'. M','. MAT','. Fig','. P','. MDL',['.'Mexext]}); CD (CWD);d ISP ('Changed Windows file associations. FIG, M, MAT, MDL, MEX, and P files is now associated with MATLAB.');
But the runtime prompts: Undefined function ' FILEASSOC ' for input arguments of type ' cell '.
Originally MATLAB 2013 modified the path of the fileassoc.m file, the new path is: [Matlabroot ' \mcr\toolbox\matlab\winfun\private '], so execute the following command to solve the problem:
Cwd=PWD;CD ([Matlabroot'\mcr\toolbox\matlab\winfun\private']); FILEASSOC ('Add',{'. M','. MAT','. Fig','. P','. MDL',['.'Mexext]});CD (CWD);d ISP ('Changed Windows file associations. FIG, M, MAT, MDL, MEX, and P files is now associated with MATLAB.');
After execution, locate the. m file you want to open, right-click Open with, select the default program, check matlab (r2013b), and tick "Always use the selected program to open this file", OK. Double-clicking the. m file will be turned on by default using MATLAB editor.
MATLAB 2013b. m file association