Installation guide
6 Editing and Debugging M-Files
• “ Tab Co mpletion for Structures” on page 6-2 5
• “Tab Completion for Properties” on page 6-26
• “U sing Tab for Spacing” on page 6-27
Basic Example — Unique Completion
This ex ample illustrates a basic use for tab completion in the Editor/Debugge r.
In an M -file opened in the Editor/Debugger, type the beginning o f a function
ormodelontheMATLABsearchpathorinthe current directory, for example,
horz
and press Tab. The Editor/Debugger automatically com pletes the name,
which for this example displays the function name
horzcat
Complete the statement, adding any argume nts, operators, or options. If the
Editor/Debugger does not complete the name
horzcat but instead moves the
cursor to the right, you do not have the preference set for tab completion. The
Editor/Debugger als o moves the cursor to the right when you try to complete a
filename; filename tab completion is not supported in the Editor/Debugger,
but is supported in the Command Window.
Yo u can use tab completion anywhere in the line, not just at the beginning.
For example, if you type
a = horz
and press Tab, the Editor/Debugger completes horzcat.
The Editor/Debugger also completes the nam es of variables in the c urrent
workspace. For example, if there is a variable
costs_march in the currently
selected works pace, type
cost and press Tab. The Editor/D ebugger completes
the variable name
costs_march. If MATLAB displays No Completions
Found
, costs_march does not exist in the current workspace.
6-22