to MATLAB
William J. Palm III
University of Rhode Island
Preface ix
C H A P T E R 1
An Overview of MATLAB® 1
1.1 MATLAB Interactive Sessions 2
1.2 Menus and the Toolbar 13
1.3 Arrays, Files, and Plots 16
1.4 Script Files and the Editor/Debugger 23
1.5 The MATLAB Help System 28
1.6 Summary 31
Key Terms with Page References 32
Problems 33
C H A P T E R 2
Numeric, Cell, and Structure Arrays 38
2.1 One- and Two-Dimensional Numeric Arrays 39
2.2 Multidimensional Numeric Arrays 49
2.3 Element-by-Element Operations 49
2.4 Matrix Operations 57
2.5 Matrix Methods for Linear Equations 69
2.6 Polynomial Operations Using Arrays 85
2.7 Cell Arrays 88
2.8 Structure Arrays 91
2.9 Summary 95
Key Terms with Page References 96
Problems 96
C H A P T E R 3
Functions and Files 120
3.1 Elementary Mathematical Functions 120
3.2 User-Defined Functions 126
3.3 Additional Function Topics 137
3.4 Working with Data Files 145
3.5 Summary 147
Key Terms with Page References 147
Problems 147
C H A P T E R 4
Decision-Making Programs 153
4.1 Relational Operators and Logical Variables 153
4.2 Logical Operators and Functions 156
4.3 Conditional Statements 163
4.4 Loops 170
4.5 The switch Structure 181
4.6 Debugging MATLAB Programs 184
4.7 Summary 187
Key Terms with Page References 188
Problems 188
C H A P T E R 5
Advanced Plotting and Model Building 205
5.1 xy Plotting Functions 205
5.2 Additional Commands and Plot Types 211
5.3 Interactive Plotting in MATLAB 224
5.4 Function Discovery 230
5.5 Regression 237
5.6 The Basic Fitting Interface 247
5.7 Three-Dimensional Plots 250
5.8 Summary 255
Key Terms with Page References 255
Problems 255
C H A P T E R 6
Statistics, Probability, and Interpolation 271
6.1 Statistics and Histograms 272
6.2 The Normal Distribution 277
6.3 Random Number Generation 283
6.4 Interpolation 289
6.5 Summary 298
Key Terms with Page References 299
Problems 300
C H A P T E R 7
Numerical Methods for Calculus and Differential Equations 305
7.1 Numerical Integration 306
7.2 Numerical Differentiation 313
7.3 First-Order Differential Equations 318
7.4 Higher-Order Differential Equations 325
7.5 Special Methods for Linear Equations 331
7.6 Summary 344
Key Terms with Page References 345
Problems 346
C H A P T E R 8
Symbolic Processing 354
8.1 Symbolic Expressions and Algebra 355
8.2 Algebraic and Transcendental Equations 362
8.3 Calculus 365
8.4 Differential Equations 370
8.5 Laplace Transforms 374
8.6 Symbolic Linear Algebra 380
8.7 Summary 384
Key Terms with Page References 384
Problems 384
A P P E N D I X A
Guide to Commands and Functions in This Text 396
A P P E N D I X B
References 408
Answers to Selected Problems 409
Index 413