# A Guide to MATLAB for Beginners and Experienced Users - Brian R.H.

**Download**(direct link)

**:**

**6**> 7 8 9 10 11 12 .. 91 >> Next

In older versions of MATLAB, for example 5.3, there is no integrated Desktop. Only the Command Window appears when you launch the application. (On UNIX systems, the terminal window from which you invoke MATLAB becomes the Command Window.) Commands that we instruct you to enter in the Command Window inside the Desktop for version 6 can be entered directly into the Command Window in version 5.3 and older versions.

Typing in the Command Window

Click in the Command Window to make it active. When a window becomes active, its titlebar darkens. It is also likely that your cursor will change from4 Chapter 1: Getting Started

File tdrt Ylew Wab Mndow ÈåÇð

Q È ¦ TJ ? Curtft Drednnr I Cr rwwi ë³ãàäòæã³Ê _I

+ Sjsjio UC Mth ¯ªÔÄÈÎ* ^tt «ami li* IEf Jvsteifliasld to SiauXlnfe TrmjLstoc »1

<14 l*U«h Ð³é I Woifcsn*» I

IxUI

²— ):04 fa --?

H I I Cammyid Hiroiy | Cunflnl OlrOtWiY | I I

ßâ»«

Figure 1-1: A MATLAB Desktop.

outline form to solid, or from light to dark, or it may simply appear. Now you can begin entering commands. Try typing 1+1; then press enter or return. Next try factor(123456789), and finally sin(10) .YourMATLAB Desktop should look like Figure 1-2.

Online Help

MATLAB has an extensive online help mechanism. In fact, using only this book and the online help, you should be able to become quite proficient with MATLAB.

You can access the online help in one of several ways. Typing help at the command prompt will reveal a long list of topics on which help is available. Just to illustrate, try typing help general. Now you see a long list of "general purpose" MATLAB commands. Finally, try help solve to learn about the command solve. In every instance above, more information than your screen can hold will scroll by. See the Online Help section in Chapter 2 for instructions to deal with this.

There is a much more user-friendly way to access the online help, namely via the MATLAB Help Browser. You can activate it in several ways; for example, typing either helpwin or helpdesk at the command prompt brings it up.Interrupting Calculations

5

File tdrt Ylew Wab Mndow ÈåÇð

Q È ¦ TJ ? Curert Drectanr | CrmM ÿ³ëàòæã³Ê _I

+ Sjsjio UC Both Te«»«« IEf Jvsteifliasld to SiauXlnfe Tcmj Lstsc To vcc BMioed^ jeierc "þòèë!) lie if Ciaa cue lltif aenu. t » Z«Wt(12¹6?09| 3 3 3«Q7 3903 » JlDUtn ¦0.5440 »1

<14 LaurKh Pirt I Woifcsn*» I

1— ):04 ffl 1/17/01 --? 1*1 ?<eUE[12M¹TB9] Ln

H I I I Comm-md Mltlorf I CunOntOliWWr I I I

Re3*

Figure 1-2: Some Simple Commands.

Alternatively, it is available through the menu bar under either View or Help. Finally, the question mark button on the tool bar will also invoke the Help Browser. We will go into more detail on its features in Chapter 2 — suffice it to say that as in any hypertext browser, you can, by clicking, browse through a host of command and interface information. Figure 1-3 depicts the MATLAB Help Browser.

If you are working with MATLAB version 5.3 or earlier, then typing help, help general, or help solve at the command prompt will work as indicated above. But the entries helpwin or helpdesk call up more primitive, although still quite useful, forms of help windows than the robust Help Browser available with version 6.

If you are patient, and not overly anxious to get to Chapter 2, you can type demo to try out MATLAB's demonstration program for beginners.

Interrupting Calculations

If MATLAB is hung up in a calculation, or is just taking too long to perform an operation, you can usually abort it by typing ctrl+c (that is, hold down the key labeled ctrl, or control, and press c).6

Chapter 1: Getting Started

Figure 1-3: The MATLAB Help Browser.

MATLAB Windows

We have already described the MATLAB Command Window and the Help Browser, and have mentioned in passing the Command History window, Current Directory browser, Workspace browser, and Launch Pad. These, and several other windows you will encounter as you work with MATLAB, will allow you to: control files and folders that you and MATLAB will need to access; write and edit the small MATLAB programs (that is, M-files) that you will utilize to run MATLAB most effectively; keep track of the variables and functions that you define as you use MATLAB; and design graphical models to solve problems and simulate processes. Some of these windows launch separately, and some are embedded in the Desktop. You can dock some of those that launch separately inside the Desktop (through the View:Dock menu button), or you can separate windows inside your MATLAB Desktop out to your computer desktop by clicking on the curved arrow in the upper right.

These features are described more thoroughly in Chapter 3. For now, we want to call your attention to the other main type of window you will encounter; namely graphics windows. Many of the commands you issue will generate graphics or pictures. These will appear in a separate window. MAT-LAB documentation refers to these as figure windows. In this book, we shallEnding a Session 7

**6**> 7 8 9 10 11 12 .. 91 >> Next