MATLAB: How to open the MATLAB Editor in MATLAB 7.5 (R2007b)

MATLABmeditor

I wish to open up my code in the MATLAB Editor without having to start up the entire MATLAB desktop environment.

Best Answer

The ability to open a file in the Editor outside of starting up a full MATLAB is available in MATLAB 7.5 (R2007b) and prior.
If you wish to view the contents of a file outside of MATLAB in versions later than R2007b, please open the file in a generic text editor such as Text Edit, Vi, Emacs, or Notepad.
For versions prior to R2007b, the following directions step through how to open the file outside of MATLAB:
Depending upon the location of the MATLAB installation files on your machine, you can locate the “meditor” executable at MATLABroot\bin\win##\meditor.exe. For example, on a machine the “meditor” executable can be located at \Program Files\MATLAB\R2007\bin\win32\.
To open up a MATLAB function without the whole MATLAB program, you could change directory to the folder containing the “meditor” executable and then run the “meditor” followed by the path to your file name. Assuming the file is called filename.m which is located at \pathname, this could be attained as follows:
1.cd MATLABroot\bin\win##\
2.meditor \pathname\filename.m
As an alternate method, you may like to create a new Windows environment variable so that you can work from any directory containing the MATLAB file. To create a new environment variable on Windows XP:
1.Right-click My Computer, and then click Properties
-or-
Click Start, click Run, type sysdm.cpl, and then click OK.
2.Click “Advanced” tab.
3.Click “Environment Variables” button.
4.Under User or System variables, click new.
5.Enter the variable name eg. meditor in “Variable name” field and the path eg. MATLABroot\bin\win##\ in the “Variable value” field.
6.Click OK
You should now be able to open the file from the command prompt without opening the MATLAB program by typing meditor \pathname\filename.