MATLAB Getting Started
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 from 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),a
nd finally sin(10).Your MATLAB Desktop should look like Figure 1-2.
Interrupting Calculations
If MATLAB is hung up in a calculation, or is just taking too long to perform
anoperation,youcanusuallyabortitbytypingCTRL+C (thatis,holddownthe
key labeled CTRL,or CONTROL, and press C).
MATLAB Windows
We have already described the MATLAB Command Window and the Help
Browser, and have mentioned in passing the Command History window, Cur-
rentDirectorybrowser,Workspacebrowser,andLaunchPad.These,andseve-
ral other windows you will encounter as you work with MATLAB, will allow
youto:controlfilesandfoldersthatyouandMATLABwillneedtoaccess;write
andeditthesmallMATLABprograms(thatis,M-files)thatyouwillutilizeto
run MATLAB most effectively; keep track of the variables and functions that
you define as you use MATLAB; and design graphical models to solve prob-
lems 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 en-
counter; 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 shall
also call them graphics windows. In Chapter 5, we will teach you how to gen-
erate and manipulate MATLAB graphics windows most effectively.
Ending a Session
ThesimplestwaytoconcludeaMATLABsessionistotypequitattheprompt.
Youcanalsoclickonthespecialsymbolthatclosesyourwindows(usuallyan×
intheupperleft-orright-handcorner).Eitherofthesemayormaynotcloseall
the other MATLAB windows (which we talked about in the last section) that
are open. You may have to close them separately. Indeed, it is our experience
that leaving MATLAB-generated windows around after closing the MATLAB
Desktopmaybehazardoustoyouroperatingsystem.Stillanotherwaytoexit
istousetheExit MATLABoptionfromtheFilemenuoftheDesktop.Before
youexitMATLAB,youshouldbesuretosaveanyvariables,printanygraphics
orotherfilesyouneed,andingeneralcleanupafteryourself
0 comments:
Post a Comment