How to enable auto word completion in the MATLAB Editor?

Syed Jamil picture Syed Jamil · Jul 11, 2010 · Viewed 22.6k times · Source

I can use auto word completion at the MATLAB command prompt by pressing tab, but I can not do that while using the Editor for an m file. Is there any way to use tab completion in the Editor?

Answer

gnovice picture gnovice · Jul 11, 2010

According to this MathWorks blog post, tab completion works in the Editor as it does in the Command Window for MATLAB R2010a, but you may have to turn it on in the Keyboard Preferences menu.

For older MATLAB versions, tab completion in the Editor only works for function names and variables that have already been created in the workspace. So, if you are writing a script with a variable foobar, and that variable hasn't yet been created in the workspace (i.e. Command Window), then foobar won't show up when using tab completion in the Editor. This was the case when I tested it in MATLAB 7.8.0 (R2009a).