When you install MATLAB® on Windows® platforms, the installer sets up associations between certain file types and MathWorks® products. When you double-click a particular file type, identified by its file extension, Windows starts MATLAB and opens the file in the appropriate tool. The following table lists the file extensions associated with MathWorks products and the behavior that results from this association.
File Extension and Resulting Action
|.fig||Opens file in figure window|
|.m||Opens file in Editor|
|.mat||Opens Import Wizard to load the data into the MATLAB workspace.|
|.slx, .mdl||Opens file in a Simulink® model window|
|.mex[a]||Displays icon for MATLAB in Windows Explorer tool|
|.p||Displays icon for MATLAB in Windows Explorer tool|
File associations for the Windows Explorer tool do not affect what happens when you open one of these file types from within MATLAB. MATLAB acts on the file using the MATLAB tool associated with that file type.
For example, if your system associates .mat files with the Access™ application, when you open a MAT-file from within MATLAB, it opens the Import Wizard to load the data. To open a .mat file with the Access application, right-click myfile.mat, and from the context menu, select Open With, then the Access application.
To associate a different file type with MATLAB, use the Windows Default Programs control pane. On Windows 7 systems:
Click the Windows Start menu.
Select Control Panel.
Select Default Programs.
Select Associate a file type or protocol with a program.
In the Set Associations window, find the file extension in the displayed list and double-click it
To change the default association, click Change Program. The Open with dialog box opens, which lists other programs that might be recommended for this file extension. If it is a file extension associated with MATLAB, such as .mat, the list includes all the versions of MATLAB you have installed.
Click OK in the Open With dialog box.
To close the Set Associations window, click Close.
For more information about using the Default Programs control pane, see your Windows documentation.
Sometimes double-clicking a MATLAB file in Windows Explorer opens a new instance of MATLAB. To work around this issue, uninstall versions of MATLAB, release R2010a or earlier. Then reinstall MATLAB R2010b or later.
Alternatively, change the security setting on the matlabroot\toolbox\local\pathdef.m file to allow the Users group to write to the file. For more information, see http://www.mathworks.com/matlabcentral/answers/93468-why-is-a-new-instance-of-matlab-opened-when-i-double-click-on-a-matlab-file-in-windows-explorer-even.