Development Environment    

Replacing a Specified String Within Files

After searching for a string within a file, you can replace the string:

  1. Open the file in MATLAB Editor. You can open the file from the Current Directory browser Find dialog box results list--see step 4 in Finding a Specified String Within a File. Be sure that the file in which you want to replace the string is the current file in the Editor.
  2. In the Editor, click the find button .
  1. The Current Directory browser Find dialog box is replaced by the Editor Find & Replace dialog box, which looks very similar.

  1. In the Look in field in the Find & Replace dialog box, select the name of the file in which you want to replace the string.
  1. The Replace button in the Find & Replace dialog box becomes selectable.

  1. In the Replace with field, type the text that is to replace the specified string.
  2. Click Replace to replace the string in the selected line, or click Replace All to replace all instances in the currently open file.
  1. The text is replaced.

  1. To save the changes, select Save from the File menu in the Editor.

  Finding and Replacing Content Within Files Accessing Source Control Features