| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
To start the MATLAB program on a Microsoft Windows platform,
select Start > Programs > MATLAB > R2009b > MATLAB R2009b, or double-click
the MATLAB shortcut
on your Windows desktop.
The installer created this shortcut when you installed MATLAB.
If you have trouble starting MATLAB, see troubleshooting information
in the Installation Guide for Windows.
To start MATLAB from a DOS window, cd to the folder in which you want to start MATLAB and type matlab at the DOS prompt.
You can specify the current folder upon startup as well as other options—for more information, see Startup Folder for the MATLAB Program and Startup Options.
After starting MATLAB, the desktop opens. Desktop components that were open when you last shut down MATLAB will be opened on startup. For more information, see Desktop.
On Windows platforms, you can start MATLAB from the Windows Explorer tool by double-clicking a file with one of these extensions: .fig, .m, .mat, and .mdl. MATLAB starts and opens in an appropriate tool. If MATLAB is already running, the file opens in an appropriate tool in the existing session.
This startup feature is based on your file type associations for the Windows operating system. When you installed MATLAB for Windows platforms, you specified the file types to associate with MATLAB. For example, if you accepted the default options, double-clicking an M-file in the Windows Explorer tool opens the file in the MATLAB Editor.
The default option also associates MEX-files and P-files with MATLAB in the Windows Explorer tool, which assigns the file types an icon for MATLAB. However, double-clicking a file with a .mex (.mexw32 or .mexw64), or .p extension does not run or open the file in MATLAB.
File Extension and Resulting Action
| File Extension | Result |
|---|---|
| .fig | Opens file in figure window |
| .m | Opens file in Editor |
| .mat | Opens Import Wizard to load the data into the MATLAB workspace |
| .mdl | Opens file in a Simulink® model window |
| .mex | Displays icon for MATLAB in Windows Explorer tool |
| .p | Displays icon for MATLAB in Windows Explorer tool |
Other applications you use can change file associations for your Windows environment. For example, the Microsoft® Access™ application might associate files having a .mat extension. Then, double-clicking a MAT-file opens the Access™ application rather than MATLAB.
If you double-click a file with one of these file extensions and it does not open in MATLAB, try this:
In the Windows Explorer tool, right-click a file that has one of the extensions for MATLAB, for example, myfile.mat.
From the context menu, select Open With. If MATLAB is one of the choices, select it to open myfile.mat in MATLAB. If MATLAB is not one of the choices, you will need to associate the file type with MATLAB using one of these techniques:
After associating a file type with MATLAB, you can open other applications that have the same extension via the context menu. For example, if you want to open a MAT-file with the Access application, right-click myfile.mat, and from the context menu, select Open With. The Access application should be one of the options.

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, even if you associate .mat files with the Access application, when you open a MAT-file from within MATLAB, it opens the Import Wizard to load the data.
If you are viewing this topic in the MATLAB Help browser, you can run one of the utilities provided here to create associations in the Windows environment for common file types used by MATLAB. This requires you to have permission to write to the HKEY_CLASSES_ROOT registry key, which typically requires power user or administrator privileges.
Run utility to associate files with .fig extension with MATLAB
Run utility to associate files with .m extension with MATLAB
Run utility to associate files with .mat extension with MATLAB
Run utility to associate files with .mdl extension with MATLAB
Run utility to associate MATLAB with all of these file types: FIG, M, MAT, MDL, MEX, and P
The file type icon in the Windows Explorer tool might not reflect the change immediately.
You can associate file types with MATLAB from the Windows Explorer tool. This is useful if you want associate file types other than those you can change with the Utility to Change File Associations for Windows Platforms. For example, you can associate the .xml extension with MATLAB so that when you double-click an XML file, it opens in the MATLAB Editor.
The following examples show one way to change file associations in the Windows Explorer tool. Note that these instructions might not exactly apply to your version of the Windows operating system. If you encounter differences or problems, try to delete the association before using these instructions, or see your Windows documentation.
Assume that when you double-click a .mat file in the Windows Explorer tool, it opens in the Microsoft Access application, but you want the file to open in MATLAB.
In the Windows Explorer tool, select Tools > Folder Options.
In the resulting Folder Options dialog box, select the File Types tab. From the Registered file types list, select the MAT extension. (If you do not see MAT in the list, click New to add it.)
Under Details for 'MAT' extension, click Change.
In the resulting Open With dialog box, select MATLAB from the list.
If the list does not include MATLAB, click Browse. Then look for and select matlab.exe, and click Open. The file is located in the folder in which you installed MATLAB. An example of the default location is C:\Program Files\MATLAB\R2009b\bin.
In the Open With dialog box, click OK. In the Folder Options dialog box, click Close.
![]() | Overview of Starting the MATLAB Program | Starting the MATLAB Program on UNIX Platforms | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |