Contents
1 MATLAB 22 Starting Up 2
2.1 Windows Systems . . . . . . . . . . 22.2 Unix Systems . . . . . . . . . . . . . 22.3 Command Line Help . . . . . . . . . 22.4 Demos . . . . . . . . . . . . . . . . . 3
3 Matlab as a Calculator 34 Numbers & Formats 35 Variables 3
5.1 Variable Names . . . . . . . . . . . . 3
6 Suppressing output 47 Built–In Functions 4
7.1 Trigonometric Functions . . . . . . . 47.2 Other Elementary Functions . . . . . 4
8 Vectors 4
8.1 The Colon Notation . . . . . . . . . 58.2 Extracting Bits of a Vector . . . . . 58.3 Column Vectors . . . . . . . . . . . . 58.4 Transposing . . . . . . . . . . . . . . 5
9 Keeping a record 610 Plotting Elementary Functions 6
10.1 Plotting—Titles & Labels . . . . . . 710.2 Grids . . . . . . . . . . . . . . . . . . 710.3 Line Styles & Colours . . . . . . . . 710.4 Multi–plots . . . . . . . . . . . . . . 710.5 Hold . . . . . . . . . . . . . . . . . . 710.6 Hard Copy . . . . . . . . . . . . . . 810.7 Subplot . . . . . . . . . . . . . . . . 810.8 Zooming . . . . . . . . . . . . . . . . 810.9 Formatted text on Plots . . . . . . . 810.10Controlling Axes . . . . . . . . . . . 9
11 Keyboard Accelerators 912 Copying to and from Word and otherapplications 10
12.1 Window Systems . . . . . . . . . . . 1012.2 Unix Systems . . . . . . . . . . . . . 10
13 Script Files 1014 Products, Division & Powers of Vec-tors 11
14.1 Scalar Product (
*
) . . . . . . . . . . 1114.2 Dot Product (
.*
) . . . . . . . . . . . 1114.3 Dot Division of Arrays (
./
) . . . . . 1214.4 Dot Power of Arrays (
.^
) . . . . . . 12
15 Examples in Plotting 1316 Matrices—Two–Dimensional Arrays 13
16.1 Size of a matrix . . . . . . . . . . . . 1416.2 Transpose of a matrix . . . . . . . . 1416.3 Special Matrices . . . . . . . . . . . 1416.4 The Identity Matrix . . . . . . . . . 1416.5 Diagonal Matrices . . . . . . . . . . 1516.6 Building Matrices . . . . . . . . . . . 1516.7 Tabulating Functions . . . . . . . . . 1516.8 Extracting Bits of Matrices . . . . . 1616.9 Dot product of matrices (
.*
) . . . . 1616.10Matrix–vector products . . . . . . . 1616.11Matrix–Matrix Products . . . . . . . 1716.12Sparse Matrices . . . . . . . . . . . . 17
17 Systems of Linear Equations 18
17.1 Overdetermined system of linear equa-tions . . . . . . . . . . . . . . . . . . 18
18 Characters, Strings and Text 2019 Loops 2020 Logicals 21
20.1 While Loops . . . . . . . . . . . . . . 2220.2
if...then...else...end
. . . . . . 23
21 Function m–files 23
21.1 Examples of functions . . . . . . . . 24
22 Further Built–in Functions 25
22.1 Rounding Numbers . . . . . . . . . . 2522.2 The
sum
Function . . . . . . . . . . . 2522.3
max
&
min
. . . . . . . . . . . . . . . 2622.4 Random Numbers . . . . . . . . . . 2622.5
find
for vectors . . . . . . . . . . . . 2722.6
find
for matrices . . . . . . . . . . . 27
23 Plotting Surfaces 2724 Timing 2825 On–line Documentation 2926 Reading and Writing Data Files 29
26.1 Formatted Files . . . . . . . . . . . . 3026.2 Unformatted Files . . . . . . . . . . 30
27 Graphic User Interfaces 3128 Command Summary 32
1
Leave a Comment