Page 5 - Applied Numerical Methods Using MATLAB
P. 5
CONTENTS
Preface xiii
1 MATLAB Usage and Computational Errors 1
1.1 Basic Operations of MATLAB / 1
1.1.1 Input/Output of Data from MATLAB Command
Window / 2
1.1.2 Input/Output of Data Through Files / 2
1.1.3 Input/Output of Data Using Keyboard / 4
1.1.4 2-D Graphic Input/Output / 5
1.1.5 3-D Graphic Output / 10
1.1.6 Mathematical Functions / 10
1.1.7 Operations on Vectors and Matrices / 15
1.1.8 Random Number Generators / 22
1.1.9 Flow Control / 24
1.2 Computer Errors Versus Human Mistakes / 27
1.2.1 IEEE 64-bit Floating-Point Number Representation / 28
1.2.2 Various Kinds of Computing Errors / 31
1.2.3 Absolute/Relative Computing Errors / 33
1.2.4 Error Propagation / 33
1.2.5 Tips for Avoiding Large Errors / 34
1.3 Toward Good Program / 37
1.3.1 Nested Computing for Computational Efficiency / 37
1.3.2 Vector Operation Versus Loop Iteration / 39
1.3.3 Iterative Routine Versus Nested Routine / 40
1.3.4 To Avoid Runtime Error / 40
1.3.5 Parameter Sharing via Global Variables / 44
1.3.6 Parameter Passing Through Varargin / 45
1.3.7 Adaptive Input Argument List / 46
Problems / 46
vii