Learn how to use the MATLAB® development environment and start programming fast. This video walks you step-by-step through the interface.
This video walks through main windows in the MATLAB interface: the Command Window, the Workspace, the Current Folder, and the Details window, and discusses the important roles each of them plays in the environment. Next, you’ll learn about window manipulation techniques, such as docking and undocking windows, creating new windows, and resetting the desktop to default settings.
Then, the video walks through logistical commands, including save, delete, load, clear, and clc, which allow for easier navigation and use of the MATLAB windows. You will also walk through the MATLAB toolstrip, with its commonly used tabs and functionalities, from Opening Files to Plotting Data to Designing Apps.
Finally, you’ll learn about the quick access toolbar, where you can reach basic MATLAB functions like the Save or Switch Windows.
Welcome, MATLAB user, to your home base for coding, where all your projects begin, the development environment. Today, we'll introduce you to the MATLAB interface in front of you and give you an overview of its functionalities. So first things first. Let's get acquainted with these windows which greet you as you open up MATLAB.
There is the Command window, the workspace, the current folder, and the details folder. The window you'll spend the most amount of time in is the Command window. This is where you can define variables, like x equals 1 to 10 or y equals log of x, and manipulate them to execute tasks, like plot x comma y.
When you define a variable, it appears over here in the workspace. This is where all your variables live while you code. And you can see helpful information about them. Plus, if you double click on a variable, it opens it in the Variable Editor tab, where you can manipulate the variable in a variety of ways, including reordering its contents, transposing its contents, and resorting its contents. And that's just to name a few. This tab is especially helpful when dealing with variables that contain large amounts of diverse data.
Next up is the current folder. Here you can see the contents and file hierarchy of the directory you're currently in, as well as move up and down in this hierarchy. Plus, if I save the variables I just made under mydata, they show up in this window and in that directory on my computer ready to be retrieved for further use. Finally, we come to the Details window. If I click on mydata in the current folder, its contents show up in details. Details conveniently previews the contents of files in your current folder.
Now that we're comfortable the various MATLAB windows, let's learn how to manipulate them to our liking. Let's use the Command History window, one that is not yet on screen, as our example. You can dock the Command History window for hitting the Up Arrow on the keyboard on the Command window. Then click this arrow here. And in the drop down menu that appears, click Dock.
Now your command history, every command you've entered recently in the command window, is docked into the MATLAB desktop. You can undock any window by clicking the same arrow and then clicking Undock. Undocked or docked, you can exit out of a window by clicking the x. And then you can bring them back by going to the Layout menu and clicking on their name, like Command History. If you want to restore the default workspace, go up to the Layout menu and hit Default to reset the desktop to default settings.
OK, we now understand how to navigate and manipulate the windows in the MATLAB desktop. It's time to finally type some commands in. Some of the essential commands you need to control your MATLAB desktop are Save, which as shown before, saves your workspace to a dot mat file in your current folder; Delete, which can delete files in your current folder; Clear, which wipes clean the workspace of any saved variables it has; Load, which can load data back into the workspace from the current folder; and finally, CLC, which wipes clean your command window, while not deleting anything from your workspace, which is a great tool for tidying up your environment.
So now we have a pretty good grasp of navigating, manipulating, and operating in the MATLAB windows. Next up, we have this other very important portion of the MATLAB interface, the tool strip. The tool strip is broken up into tabs, with some global tabs always being present and contextual tabs which only appear when needed.
First step, we have the Home tab, which contains many important command buttons and icons for commonly-used functionality in MATLAB. You can make variety of new things, from live scripts to models, open files, import and manipulate data, open Simulink, edit the environment itself, and ask for help if you need it.
The Plots tab is where you can plot selected variables. We can even plot our data from earlier and have it appear in the Figure window. The Apps tab is where you can find all your applications, both ones from MathWorks and ones you've built yourself. You can design or install new apps or utilize ones you already own.
To use an app, like Curve Fitting, just click on it, then load in your data, like our trusty x and y, and examine the results. In addition to the tool strip tabs, up here there is also the Quick Access toolbar, which provides you with many tools that can be utilized throughout MATLAB, like save, copy-paste, and switch windows. A particularly helpful tool in the tool strip is the Help menu, which you can consult for any further questions regarding the MATLAB environment.
OK, we've broken down all the windows and all the tool strips and all the toolbars of MATLAB. Now you can get out there and conquer some code with your knowledge of the MATLAB development environment. Thanks for tuning in, and I'll see you guys in another video.
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.