MATLAB is a mathematical and graphical software package with numerical, graphical, and programming capabilities. It includes an integrated development environment, as well as both procedural and object-oriented programming constructs. It has built-in functions to perform many operations, and there are Toolboxes that can be added to augment these functions (e.g., for signal processing). There are versions available for different hardware platforms, in both professional and student editions. The MathWorks releases two versions of MATLAB annually, named by the year and ‘a’ orb’. This post covers the releases through Version R2016a. In cases where there have been changes in recent years, these are noted.
When the MATLAB software is started, a window opens in which the main part is the Command Window (see Fig. 1). In the Command Window, you should see:
is called the prompt. In the Student Edition, the prompt instead is:
In the Command Window, MATLAB can be used interactively. At the prompt, any MATLAB command or expression can be entered, and MATLAB will respond immediately with the result.
It is also possible to write programs in MATLAB that are contained in script files or MATLAB code files.
The following commands can serve as an introduction to MATLAB and allow you to get help:
• demo will bring up MATLAB Examples in the Help Browser, which has examples of some of the features of MATLAB.
• help will explain any function; help help will explain how help works . This function open help of a function in command window.
• lookfor searches through the help for a specific word or phrase (Note: this can take a long time).
• doc will bring up a documentation page in the Help Browser. We recommend to use this command.
To exit from MATLAB, either type quit or exit at the prompt, or click on MATLAB, then Quit MATLAB from the menu.
If you close MATLAB suddenly, without exit command, Your work may remove and the position of window will return to default. When you work on a big project and you like to continue your work at next time, default layout is very bad for you. So , try to use exit command at end of your work.
The MATLAB Desktop Environment
In addition to the Command Window, there are several other windows that can be opened and may be opened by default. What is described here is the default layout for these windows in Version R2016a, although there are other possible configurations. Different versions of MATLAB may show other configurations by default, and the layout can always be customized. Therefore, the main features will be described briefly here.
To the left of the Command Window is the Current Folder Window. The folder that is set as the Current Folder is where files will be saved. This window shows the files that are stored in the Current Folder. These can be grouped in many ways, for example by type, and sorted, for example by name. If a file is selected, information about that file is shown on the bottom where it says “Details.”
To the right of the Command Window are the Workspace Window on top and the Command History Window on the bottom. The Command History Window shows commands that have been entered, not just in the current session (in the current Command Window), but previously as well. The Workspace Window will be described in the next post.
This default configuration can be altered by clicking the down arrow at the top right corner of each window. This will show a menu of options (different for each window), including, for example, closing that particular window and undocking that window. Once undocked, bringing up the menu and then clicking on the curled arrow pointing to the lower right will dock the window again.
To make any of these windows the active window, click the mouse in it. By default the active window is the Command Window.
Beginning with Version 2012b, the Desktop now has a toolstrip. By default, three tabs are shown (“HOME,” “PLOTS,” and “APPS“), although another, “SHORTCUTS,” can be added.
Under the “HOME” tab there are many useful features, which are divided into functional sections “FILE,” “VARIABLE,” “CODE,” “ENVIRONMENT,” and “RESOURCES” (these labels can be seen on the very bottom of the grey toolstrip area). For example, under “ENVIRONMENT,” hitting the down arrow under Layout allows for customization of the windows within the Desktop Environment including adding the SHORTCUTS tab.