Why do I receive an error about the EDITOR environment variable when running MATLAB in nodisplay mode?
12 views (last 30 days)
Show older comments
Why do I receive an error about the EDITOR environment variable when running MATLAB in nodisplay mode?
When I run MATLAB in nodisplay mode and try to run the editor, I receive the following error:
Error: Environment variable EDITOR is not set.
??? Error using ==> system_dependent
Unknown service.
Error in ==> /devel/archive/R13/fcs/ship/unix/install/all/toolbox/matlab/general/edit.m (editor)
On line 249 ==> system_dependent('miedit', '');
Error in ==> /devel/archive/R13/fcs/ship/unix/install/all/toolbox/matlab/general/edit.m
On line 35 ==> errMessage = editor;
Accepted Answer
MathWorks Support Team
on 9 Mar 2010
This is an intended behavior. To use the MATLAB Editor, you must run MATLAB with a display. You can do this by setting your DISPLAY environment variable or by starting MATLAB without the -nodisplay option.
Here are some instructions on how this could be done:
1) Start MATLAB from the Terminal Window in -nodisplay mode.
% matlab -nodisplay
2) Once MATLAB starts in the terminal use the SETENV and GETENV function to explore/change the environment variables.
3) To get the current variable value:
>> getenv EDITOR
4) To change it use the following:
>> setenv('EDITOR','emacs');
>> edit % this should launch the Emacs editor.
0 Comments
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!