11.07.2015 Views

MatlabNotes

MatlabNotes

MatlabNotes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Contents1 MATLAB 22 Starting Up 23 Matlab as a Calculator 34 Numbers & Formats 35 Variables 35.1 Variable Names . . . . . . . . . . 36 Suppressing output 47 Built–In Functions 47.1 Trigonometric Functions . . . . . 47.2 Other Elementary Functions . . . 48 Vectors 58.1 The Colon Notation . . . . . . . 58.2 Extracting Parts of Vectors . . . 68.3 Column Vectors . . . . . . . . . . 68.4 Transposing . . . . . . . . . . . . 69 Keeping a record 710 Script Files 711 Keyboard Accelerators 812 Arithmetic with Vectors 812.1 Inner Product (*) . . . . . . . . . 812.2 Elementwise Product (.*) . . . . 912.3 Elementwise Division (./) . . . . 1012.4 Elementwise Powers (.^) . . . . . 1113 Plotting Functions 1213.1 Plotting—Titles & Labels . . . . 1213.2 Grids . . . . . . . . . . . . . . . . 1213.3 Line Styles & Colours . . . . . . 1213.4 Multi–plots . . . . . . . . . . . . 1313.5 Hold . . . . . . . . . . . . . . . . 1313.6 Hard Copy . . . . . . . . . . . . 1313.7 Subplot . . . . . . . . . . . . . . 1413.8 Zooming . . . . . . . . . . . . . . 1413.9 Figure Properties . . . . . . . . . 1413.10Formatted text on Plots . . . . . 1513.11Controlling Axes . . . . . . . . . 1615 Two–Dimensional Arrays 1715.1 Size of a matrix . . . . . . . . . . 1815.2 Transpose of a matrix . . . . . . 1815.3 Special Matrices . . . . . . . . . 1815.4 The Identity Matrix . . . . . . . 1915.5 Diagonal Matrices . . . . . . . . 1915.6 Building Matrices . . . . . . . . . 2015.7 Tabulating Functions . . . . . . . 2015.8 Extracting Parts of Matrices . . 2015.9 Elementwise Products (.*) . . . 2115.10Matrix–vector products . . . . . 2115.11Matrix–Matrix Products . . . . . 2215.12Sparse Matrices . . . . . . . . . . 2316 Systems of Linear Equations 2316.1 Overdetermined systems . . . . . 2417 Characters, Strings and Text 2618 Loops 2719 Timing 2820 Logicals 2820.1 While Loops . . . . . . . . . . . . 2920.2 if...then...else...end . . . . 3021 Further Built–in Functions 3121.1 Rounding Numbers . . . . . . . . 3121.2 The sum Function . . . . . . . . . 3121.3 max & min . . . . . . . . . . . . . 3221.4 Random Numbers . . . . . . . . 3221.5 find for vectors . . . . . . . . . . 3221.6 find for matrices . . . . . . . . . 3222 Function m–files 3323 Plotting Surfaces 3624 Reading/Writing Data Files 3824.1 Formatted Files . . . . . . . . . . 3924.2 Unformatted Files . . . . . . . . 3925 Graphic User Interfaces 4026 Command Summary 4114 Elementwise Examples 171

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!