Programming and Data Types    

Development Environment

This section covers the following topics:

Workspace Browser

The Workspace Browser is a graphical interface to the variables stored in the MATLAB base and function workspaces. You can view, modify, save, load, and create graphics from workspace data using the browser. Select View -> Workspace to open the browser.

To view function workspaces, you need to be in debug mode.

For more information: See MATLAB Workspace in the MATLAB "Development Environment" documentation

Using the Find and Replace Utility

Find any word or phrase in a group of files using the Find and Replace utility. Click on View -> Current Directory, and then click on the binoculars icon at the top of the Current Directory window.

When entering search text, you don't need to put quotes around a phrase. In fact, parts of words, like win for windows, will not be found if enclosed in quotes.

For more information: See Finding and Replacing a String in the MATLAB "Development Environment" documentation

Commenting Out a Block of Code

To comment out a block of text or code within the MATLAB editor,

  1. Highlight the block of text you would like to comment out.
  2. Holding the mouse over the highlighted text, select Text -> Comment (or Uncomment, to do the reverse) from the toolbar. (You can also get these options by right-clicking the mouse.)

For more information: See Commenting in the MATLAB "Development Environment" documentation

Creating M-Files from Command History

If there is part of your current MATLAB session that you would like to put into an M-file, this is easily done using the Command History window:

  1. Open this window by selecting View -> Command History.
  2. Use Shift+Click or Ctrl+Click to select the lines you want to use. MATLAB highlights the selected lines.
  3. Right click once, and select Create M-File from the menu that appears. MATLAB creates a new Editor window displaying the selected code.

Editing M-Files in EMACS

If you use Emacs, you can download editing modes for editing M-files with GNU-Emacs or with early versions of Emacs from the MATLAB Central Web site:

At this Web site, select File Exchange, and then Utilities -> Emacs.

For more information: See General Preferences for the Editor/Debugger in the MATLAB "Development Environment" documentation

  Help M-File Functions