2.1. The MATLAB Development Environment

The MATLAB integrated development environment (IDE), is conducive for rapid program development. It consists of the following.

  • MATLAB Desktop: This typically contains five subwindows: the Command Window, the Workspace Browser, the Current Directory Window , the Command History Window, and one or more Figure Windows, which are visible when the user displays a graphic, such as a plot.
  • MATLAB Editor: This is used to create and edit M-files. It includes a number of useful functions for saving, viewing, and debugging M-files.
  • Help System: This includes the Help Browser, which displays HTML documents and contains a number of search and display options.
../_images/matlab_IDE.png

The MATLAB Integrated Development Environment

The interaction between the Command Window, Workspace Browser, and the Editor make a convenient environment for software development.

  • In the command window, one may interactively type commands. Simple calculations may be entered using only the command window. It is also nice for testing commands and syntax before adding those commands to a file in the editor.

  • Variable values and data size can be viewed either from the command window or the workspace browser.

  • In the editor, one can type code into scripts and functions so that they will be saved for future use.

    When writing a script file, commands in the script can be run as though they were typed in the command window.

  • The debugger can be used to set breakpoints to stop the execution at set places. With the execution stopped, one can use the command window to determine why a problem may exist.

    A strategy that is useful for debugging functions, is to develop the code first as a script and then change it to a function when it is known to be correct.

2.1.1. Options for using MATLAB

  • Use K-State’s MATLAB floating licenses from campus lab computers.
  • A student license is fairly affordable. With a student license, you also have access to MATLAB Online and MATLAB Mobile. MATLAB Online makes gives access to MATLAB from an Internet connected computer.
  • A mostly compatible, open source alternative, called Octave is also available.

These options will be discussed in class.