Using Simulink Previous page   Next Page

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:

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.

  1. Click the Find & Replace toolbar button .
  1. 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.

  1. Enter the text that you want to search for in the Find what field.
  2. Modify the text you want to search for by checking any or all of the following:
  3. Enter the text that you want to substitute in the Replace with field.
  4. Click the Find button to find a single occurrence of the text in the Find what field.
  1. If the text is present in the Embedded MATLAB Editor, it is highlighted with a gray background.

  1. Click the Replace button to replace highlighted text in the editor with the text specified for the Replace with field.
  2. 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.

Previous page  Changing the Embedded MATLAB Editor Defining Embedded MATLAB Function Arguments Next page

© 1994-2005 The MathWorks, Inc.