Sarah Zaranek, MathWorks
Access tools such as the command history workspace browser and variable editor, save and load your workspace data, and manage windows and desktop layout.
This video tutorial will introduce a number of features of the MATLAB® Development Environment, also known as the MATLAB Desktop. Here you’ll find tools to execute commands, inspect and manage your data, and to create and manage your programs.
The toolstrip contains command buttons and icons for commonly used functionality in MATLAB. It is organized by tabs that group related functionality. The toolstrip contains a number of global tabs, such as the Home tab, that are always present, and contextual tabs that become available when you need them.
The command window allows you to enter commands such as,
x=1:10; % x = 1 to 10 y=log(x); % y = log of x plot(x,y); % and plot (x,y)
When you enter commands they are recorded in the command history.
You can re-execute previously entered commands by double-clicking them,
or, by dragging them back into the command window for modification such as,
plot(x,y,'*'); % plot x, y with star markers
The variables x and y are contained in what is called the MATLAB base workspace, as well as by using the whos command to get information on them:
The Workspace Browser lists their names, values, and other statistics which can be customized by right-clicking and selecting the options that you wish to view.
Double-clicking on a variable opens it in the Variable Editor. When you open the Variable Editor, the related tabs also appear. You can modify your variable interactively and plot using the Plot Gallery in the Plots tab of the toolstrip. The gallery contains a large variety of available plot types to choose from, depending on how you want to visualize your data. You can plot directly from the Workspace Browser. The windows that are generated by plotting commands, known as figures, can be docked in the desktop for easier management.
You can save all the variables in the MATLAB workspace to a file on disk by using the save command:
Save mydata creates a mydata.mat file on disk (visible in the current folder browser), which shows the contents of your computer's file system.
You can also create a MAT-File by right-clicking on selected variables in the Workspace Browser and choosing Save As.
You can clear individual variables or the entire workspace with the clear command, such as
or, just clear
You can load your saved variables back into the workspace using the load command, such as
or, by double-clicking on MAT-files in the current folder browser. You can preview the contents of many file types by looking in the details panel.
You can change the locations of tools, close them, and bring them back using the Layout pull down menu. You can minimize them, access them temporarily by hovering over them, restore them by double clicking, and undock them completely by dragging them out. You can return the desktop to the default layout using the Layout menu.
The Apps tab gives quick access to interactive applications from the MATLAB product family. You can also package your own applications to share with others. When installed, those apps will also be available in the Apps tab.
The Quick Access Toolbar is a place to put your commonly used functionality. By default, it contains functionality such as cut, copy, paste, and the ability to switch between panels. The Quick Access Toolbar is customizable; you can add items from tabs. Shortcuts can be created to contain MATLAB commands that you use regularly and are placed in the quick access toolbar. A Shortcuts tab also contains your shortcuts.
The Current Folder Browser and other development tools, such as the Editor used in the creation and management of MATLAB program files, are covered further in other videos.
That concludes the demonstration. Try these examples in MATLAB now or watch one of these other videos.