Engineering - Using Matlab 6(1).pdf

(6725 KB) Pobierz
Using MATLAB
M AT LA B ®
The Language of Technical Computing
Compu tation
Visuali zation
Program ming
Using MATLAB
Version 6
262955213.010.png
How to Contact The MathWorks:
www.mathworks.com
Web
comp.soft-sys.matlab
Newsgroup
support@mathworks.com
Technical support
suggest@mathworks.com
Product enhancement suggestions
bugs@mathworks.com
Bug reports
doc@mathworks.com
Documentation error reports
service@mathworks.com
Order status, license renewals, passcodes
info@mathworks.com
Sales, pricing, and general information
508-647-7000
Phone
508-647-7001
Fax
The MathWorks, Inc.
Mail
3 Apple Hill Drive
Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site.
COPYRIGHT 1984 - 2001 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used
or copied only under the terms of the license agreement. No part of this manual may be photocopied or repro-
duced in any form without prior written consent from The MathWorks, Inc .
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by
or for the federal government of the United States. By accepting delivery of the Program, the government
hereby agrees that this software qualifies as "commercial" computer software within the meaning of FAR
Part 12.212, DFARS Part 227.7202-1, DFARS Part 227.7202-3, DFARS Part 252.227-7013, and DFARS Part
252.227-7014. The terms and conditions of The MathWorks, Inc. Software License Agreement shall pertain
to the government’s use and disclosure of the Program and Documentation, and shall supersede any
conflicting contractual terms or conditions. If this license fails to meet the government’s minimum needs or
is inconsistent in any respect with federal procurement law, the government agrees to return the Program
and Documentation, unused, to MathWorks.
MATLAB, Simulink, Stateflow, Handle Graphics, and Real-Time Workshop are registered trademarks, and
Target Language Compiler is a trademark of The MathWorks, Inc.
Other product or brand names are trademarks or registered trademarks of their respective holders.
Printing History: December 1996 First printing First Printing for MATLAB 5
June 1997 Second printing Revised for MATLAB 5.1
January 1998 Third printing Revised for MATLAB 5.2
January 1999 Fourth printing Revised for MATLAB 5.3 (Release 11)
November 2000 Fifth printing Revised for MATLAB 6 (Release 12)
June 2001
Online only
Revised for MATLAB 6.1 (Release 12.1)
Using MATLAB
Ó
262955213.011.png 262955213.012.png 262955213.013.png 262955213.001.png 262955213.002.png 262955213.003.png
Contents
Development Environment
1
Starting and Quitting MATLAB
Starting MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Starting MATLAB on Windows Platforms . . . . . . . . . . . . . . . . . 1-3
Starting MATLAB on UNIX Platforms . . . . . . . . . . . . . . . . . . . 1-3
Startup Directory for MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Startup Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
Reducing Startup Time with Toolbox Path Caching . . . . . . . . 1-10
Quitting MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15
Running a Script When Quitting MATLAB . . . . . . . . . . . . . . . 1-15
2
Using the Desktop
Desktop Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Launch Pad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Configuring the Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Opening and Closing Desktop Tools . . . . . . . . . . . . . . . . . . . . . . 2-7
Resizing Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Moving Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
Using Predefined Desktop Configurations . . . . . . . . . . . . . . . . 2-16
Common Desktop Features . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
Desktop Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
Context Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
i
262955213.004.png 262955213.005.png 262955213.006.png
Keyboard Shortcuts and Accelerators . . . . . . . . . . . . . . . . . . . . 2-18
Selecting Multiple Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19
Using the Clipboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
Accessing The MathWorks on the Web . . . . . . . . . . . . . . . . . . . 2-20
Setting Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21
General Preferences for MATLAB . . . . . . . . . . . . . . . . . . . . . . 2-23
3
Running MATLAB Functions
The Command Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Opening the Command Window . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Running Functions and Entering Variables . . . . . . . . . . . . . . . . 3-2
Controlling Input and Output . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
Running Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
Keeping a Session Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
Preferences for the Command Window . . . . . . . . . . . . . . . . . . . 3-13
Command History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17
Viewing Functions in the Command History Window . . . . . . . 3-17
Running Functions from the Command History Window . . . . 3-18
Copying Functions from the Command History Window . . . . 3-19
4
Getting Help
Types of Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Using the Help Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Changing the Size of the Help Browser . . . . . . . . . . . . . . . . . . . 4-5
Using the Help Navigator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Using the Product Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
ii
Contents
262955213.007.png 262955213.008.png
Viewing the Contents Listing in the Help Browser . . . . . . . . . . 4-9
Finding Documentation Using the Index . . . . . . . . . . . . . . . . . 4-11
Searching Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
Bookmarking Favorite Pages . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
Viewing Documentation in the Display Pane . . . . . . . . . . . 4-17
Browsing to Other Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18
Bookmarking Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18
Revisiting Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
Printing Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
Finding Terms in Displayed Pages . . . . . . . . . . . . . . . . . . . . . . 4-19
Copying Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
Evaluating a Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
Viewing the Page Source (HTML) . . . . . . . . . . . . . . . . . . . . . . . 4-20
Viewing Web Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20
Preferences for the Help Browser . . . . . . . . . . . . . . . . . . . . . 4-21
Documentation Location – Specifying the help Directory . . . . 4-22
Product Filter – Limiting the Product Documentation . . . . . . 4-23
PDF Reader – Specifying Its Location . . . . . . . . . . . . . . . . . . . 4-23
General – Synchronizing the Contents Pane
with the Displayed Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23
Help Fonts Preferences – Specifying Font Name,
Style, and Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24
Printing Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26
Printing a Page from the Help Browser . . . . . . . . . . . . . . . . . . 4-26
Printing the PDF Version of Documentation . . . . . . . . . . . . . . 4-26
Using Help Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28
Viewing Function Reference Pages – the doc Function . . . . . . 4-29
Getting Help in the Command Window – the help Function . 4-29
Other Methods for Getting Help . . . . . . . . . . . . . . . . . . . . . . . 4-31
Product-Specific Help Features . . . . . . . . . . . . . . . . . . . . . . . . . 4-31
Running Demos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-31
Contacting Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . 4-32
Providing Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-32
Getting Version and License Information . . . . . . . . . . . . . . . . 4-32
iii
262955213.009.png
Zgłoś jeśli naruszono regulamin