Tài liệu MATLAB ® The Language of Technical Computing P1 doc - Pdf 91

Computation
Visualization
Programming
Using MATLAB
Version 6
M
ATLAB
®
The Language of Technical Computing
How to Contact The MathWorks:
www.mathworks.com
Web
comp.soft-sys.matlab
Newsgroup
[email protected]
Technical support
[email protected]
Product enhancement suggestions
[email protected]
Bug reports
[email protected]
Documentation error reports
[email protected]
Order status, license renewals, passcodes
[email protected]
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

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 . . . . . . . . . . . . . . . .

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
iii
Viewing the Contents Listing in the Help Browser . . . . . . . . . .
4-9

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

5-20
Viewing and Making Changes to Directories . . . . . . . . . . . . . .
5-22
Creating, Renaming, Copying, and
Removing Directories and Files . . . . . . . . . . . . . . . . . . . . . . . .
5-23
Opening, Running, and Viewing the Content of Files . . . . . . .
5-26
Finding and Replacing Content Within Files . . . . . . . . . . . . . .
5-28
Preferences for the Current Directory Browser . . . . . . . . . . . .
5-30
6
Importing and Exporting Data
Importing Text Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-4
Using the Import Wizard with Text Data . . . . . . . . . . . . . . . . .
6-4
Using Import Functions with Text Data . . . . . . . . . . . . . . . . . .
6-9
Importing Numeric Text Data . . . . . . . . . . . . . . . . . . . . . . . . . .
6-11
Importing Delimited ASCII Data Files . . . . . . . . . . . . . . . . . . .
6-12
Importing Numeric Data with Text Headers . . . . . . . . . . . . . .
6-13
v
Importing Mixed Alphabetic and Numeric Data . . . . . . . . . . .
6-14
Exporting ASCII Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6-51
Opening Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-52
Reading Binary Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-54
Writing Binary Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-55
Controlling Position in a File . . . . . . . . . . . . . . . . . . . . . . . . . .
6-56
Reading Strings Line-By-Line from Text Files . . . . . . . . . . . .
6-58
Reading Formatted ASCII Data . . . . . . . . . . . . . . . . . . . . . . . .
6-59
Writing Formatted Text Files . . . . . . . . . . . . . . . . . . . . . . . . . .
6-61
Closing a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-62
7
Editing and Debugging M-Files
Starting the Editor/Debugger . . . . . . . . . . . . . . . . . . . . . . . . . .
7-3
Creating a New M-File in the Editor/Debugger . . . . . . . . . . . . .
7-4
Opening Existing M-Files in the Editor/Debugger . . . . . . . . . .
7-5
vi
Contents
Opening the Editor Without Starting MATLAB . . . . . . . . . . . .
7-6
Closing the Editor/Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7-37
Display Preferences for the Editor/Debugger . . . . . . . . . . . . . .
7-38
Keyboard and Indenting Preferences for the Editor/Debugger
7-40
Printing Preferences for the Editor/Debugger . . . . . . . . . . . . .
7-42
8
Improving M-File Performance – the Profiler
What Is Profiling? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-3
Using the Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-4
The profile Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-4
An Example Using the Profiler . . . . . . . . . . . . . . . . . . . . . . . . . .
8-6
Viewing Profiler Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-7
Viewing Profile Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-7
Profile Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-12
Saving Profile Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-13
vii
9
Interfacing with Source Control Systems
Process of Interfacing to an SCS . . . . . . . . . . . . . . . . . . . . . . . .
9-3

10-6
Ensuring Data Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10-7
Defining MATLAB Commands as Input Cells . . . . . . . . . . .
10-8
Defining Cell Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10-8
Defining Autoinit Input Cells . . . . . . . . . . . . . . . . . . . . . . . . .
10-10
Defining Calc Zones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10-10
Converting an Input Cell to Text . . . . . . . . . . . . . . . . . . . . . .
10-11
Evaluating MATLAB Commands . . . . . . . . . . . . . . . . . . . . .
10-12
Evaluating Cell Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10-13
viii
Contents
Evaluating a Range of Input Cells . . . . . . . . . . . . . . . . . . . . .
10-14
Evaluating a Calc Zone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10-14
Evaluating an Entire M-Book . . . . . . . . . . . . . . . . . . . . . . . . .
10-15
Using a Loop to Evaluate Input Cells Repeatedly . . . . . . . . .
10-15
Converting Output Cells to Text . . . . . . . . . . . . . . . . . . . . . . .
10-16
Deleting Output Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10-29
Evaluate M-Book Command . . . . . . . . . . . . . . . . . . . . . . . . . .
10-30
Group Cells Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10-30
Hide Cell Markers Command . . . . . . . . . . . . . . . . . . . . . . . . .
10-31
Notebook Options Command . . . . . . . . . . . . . . . . . . . . . . . . . .
10-31
Purge Output Cells Command . . . . . . . . . . . . . . . . . . . . . . . .
10-31
Toggle Graph Output for Cell Command . . . . . . . . . . . . . . . .
10-31
Undefine Cells Command . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10-32
Ungroup Cells Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10-32
ix
Mathematics
11
Matrices and Linear Algebra
Function Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11-3
Matrices in MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11-5
Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11-5
Addition and Subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11-7
Vector Productsand Transpose . . . . . . . . . . . . . . . . . . . . . . . . .

11-26
QR Factorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11-28
Matrix Powers and Exponentials . . . . . . . . . . . . . . . . . . . . .
11-32
Eigenvalues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11-35
Singular Value Decomposition . . . . . . . . . . . . . . . . . . . . . . .
11-39
x
Contents
12
Polynomials and Interpolation
Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12-3
Polynomial Function Summary . . . . . . . . . . . . . . . . . . . . . . . . .
12-3
Representing Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12-4
Polynomial Roots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12-4
Characteristic Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12-5
Polynomial Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12-5
Convolution and Deconvolution . . . . . . . . . . . . . . . . . . . . . . . .
12-6
Polynomial Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12-6
Polynomial Curve Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Covariance and Correlation Coefficients . . . . . . . . . . . . . . . .
13-11
Finite Differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13-12


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status