This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Chapter 2 Getting Started with MATLAB T o gain the most from this book, you should, as you read it, be continually writing and testing examples in Matlab. To run the examples in this book you should have the following version of Matlab installed on your computer: Version 7, Release 14 Service Pack 2. Earlier versions will not behave as expected. 2.1 Starting and stopping Matlab When Matlab is installed on your computer, the Matlab icon should appear: To start Matlab, double click on the Matlab icon. You should see the "MATLAB Desktop" appear. (Its appearance will vary slightly according to the operating system and version of Matlab.) The Desktop displays three windows: the “Workspace” at the upper left, the “Command History” at the lower left, and the “Command Window” at the right. You will learn to type commands into the command window. When you are ready to quit Matlab, you type quit in that window, >> quit and hit Enter . Matlab will then close all open windows and quit. If you have files open, you will be asked about saving open files and given a chance to save them. You can also quit by clicking with the left mouse button on the × at the top right of the Matlab desktop. 2.2 Current Directory In Matlab, the term “directory”, is synonymous with the term “folder”, as it is used in Windows and in Apple’s operating systems. The term “directory” is the term usually used in Unix and Linux systems. Since we are using Matlab, we will use the term directory. When Matlab is running, there is a special directory, called the "Current Directory" where Matlab expects to find files that you want to open and will store files that you want to save. You should change this directory from the one selected by Matlab to the one in which you want to keep your files. To do this, move your mouse over the three arrows, pointed at in the figure by the arrow. A button will appear. Click on the button. When you click on this button, a window will pop up showing the directory structure that is accessible from your computer. Click on the directory you wish to use and then click OK. You will then see that the name of the current directory that appears in the space to the left of the button with the three dots has now changed to the one that you chose. 2.2.1 Path When Matlab fails to find a file that it is looking for in the Current Directory, it does not give up. It looks in other directories. It follows a path searching in one directory after another. A “path”, in this context, is a list of directories through which a program searches for a file. The notion of a search path occurs in operating systems such as Unix, Windows, and Mac OS and in many programming environments. Matlab comes with a path already set up, but you can change it by adding or removing directories....
View
Full Document
 Spring '07
 FITZPATRICK
 matlab, command window

Click to edit the document details