MATLAB Community

MATLAB, community & more

Tab Completion will save your fingers

Tab Completion is a popup that can be found in both the Command Window and the Editor. After you type a key (or a few) you can hit the tab key and a popup will appear and show you all of the possible completions, including variable names and figure properties. If you are a horrible typist like I am, this can save you from having to type the whole string and hit backspace over the typos. It is also useful when you just can’t remember the functionname. I find myself sometimes thinking, “I know that the function I want to call here starts with ‘str’…”. Hitting tab in this case shows me all of the functions that start with that string.

tabcompletion.jpg

Once the popup has appeared, you can continue to type to narrow your choices or you can arrow to the correct item and then hit tab or enter to insert that completion into the window.

Some long-time users of MATLAB will fondly recall the old days when the completions printed to the window. Hitting tab 2x would display any completions in the output area. If your fingers still try to do this, there is a preference in the “Keyboard” section of Preferences called “Tab key narrows completions”. This preference changes the behavoir of tab completion to work more like the old tab completion. When the popup is showing, you can type a few keys and hit tab again to narrow the completions. Hit enter to select a completion.

tabpref.jpg

Do you use the tab completion popup in the default mode or in the “tab narrows” mode?

|

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.