Skip to main content
Engineering LibreTexts

1.2: Layout

  • Page ID
    14909
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    We now take a look at the (default) layout of Matlab:

    clipboard_e0329dff06f35dc956b425349522d1bb9.png

    You can customize how the layout appears, but there are a few main components:

    Command Window:
    The command window is where you can perform basic calculations, enter commands, run programs, and view the numeric output.

    Command History:
    The command history keeps a record of past commands that were entered in the command window. To run a command again from the command history, you can simply double click it. Or, if you want to alter the command before running it, you can click and drag it to the command window, change it and then run it (by hitting Enter).

    Directory and Workspace (in tabs):
    The directory shows the files in the current directory (which itself is listed at the top of the screen). These files can be run by double clicking, or by clicking and dragging them into the command window. The workspace keeps track of the variables that are created. Double clicking a variable in the workspace opens a spreadsheet where the variable can be altered.

    Current Directory:
    When you run any program, it is important that your Current Directory is set to the location of your program. You can also run programs in a different directory by setting the “path” to that directory. To keep it simple, we will not explain how to do this here, but refer you to the help files.

    Help:
    The help capabilities in Matlab are well documented. It does take some time to understand Matlab syntax, but if a user is familar with another programming language, the commands are easy to pick up. Functions in Matlab are also well named, so you can often guess the name of a function that you may need.


    This page titled 1.2: Layout is shared under a CC BY-NC 3.0 license and was authored, remixed, and/or curated by Troy Siemers (APEX Calculus) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.