| Using Simulink |
 |
Editing the Embedded MATLAB Function
Use the tools in the following topics to edit an Embedded MATLAB function in the Embedded MATLAB Editor:
Undoing and Redoing Operations
Tool Button
|
Description
|
Undo
|
Undo the effects of the preceding operation. Alternatively, from the Edit menu, select Undo.
|
Redo
|
Redo the effects of the most recently undone operation. Alternatively, from the Edit menu, select Redo.
|
Comment and Uncomment Embedded MATLAB Function Lines
You can comment text or uncomment commented text as follows:
- To turn selected function text lines into commented text lines, from the Text menu, select Comment.
- To turn selected comment text lines into function text lines, from the Text menu, select UnComment.
Any text selected on a line, or the presence of the text cursor, selects the line.
Going to a Specified Line of the Embedded MATLAB Function
To place the text cursor at the beginning of a specified line, from the Edit menu, select Go to Line. In the resulting dialog box, enter the line number and click OK.
Searching for and Replacing Text in Embedded MATLAB Functions
You can use the Find & Replace tool to search and replace text in the Embedded MATLAB Editor as follows.
- Click the Find & Replace toolbar button
.
- The Find & Replace dialog box appears.

By default, the Look in field is set to search the current Embedded MATLAB function, but you can select from any Embedded MATLAB functions that you have open for editing.
- Enter the text that you want to search for in the Find what field.
- Modify the text you want to search for by checking any or all of the following:
- Match case -- The found text must match the case of the text in the Find what field.
- Whole word -- The found text must be a whole word and not part of a larger word.
- Wrap around -- Continue searching after reaching the bottom of the editor. Otherwise, stop searching.
- Enter the text that you want to substitute in the Replace with field.
- Click the Find button to find a single occurrence of the text in the Find what field.
- If the text is present in the Embedded MATLAB Editor, it is highlighted with a gray background.
- Click the Replace button to replace highlighted text in the editor with the text specified for the Replace with field.
- Click the Replace All button to replace every occurrence of the text specified in the Find what field with the text specified for the Replace with field.
| Changing the Embedded MATLAB Editor | | Defining Embedded MATLAB Function Arguments |  |
© 1994-2005 The MathWorks, Inc.