Numerical Computation with Matlab solutions

numerical computing matlab solution manual and numerical computing with matlab moler solutions and matlab programming for numerical computation
EdenKelly Profile Pic
EdenKelly,United States,Professional
Published Date:12-07-2017
Your Website URL(Optional)
Comment
Course Notes for MS4024 Numerical Computation Part 1 Matlab J. Kinsella February 6, 2012 0-0MS4024 Numerical Computation Part 1 Matlab 0-1 Contents 0 About the Course 1 0.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . 7 0.2 Module Description/Syllabus . . . . . . . . . . . . . . . . 8 0.3 Learning Outcomes . . . . . . . . . . . . . . . . . . . . . . 9 0.4 Recommended Texts . . . . . . . . . . . . . . . . . . . . . 10 I Matlab 12 1 File Management 12 1.1 Procedure For Uploading Your Work To The Server At The End Of A Class . . . . . . . . . . . . . . . . . . . . . 13MS4024 Numerical Computation Part 1 Matlab 0-2 1.2 Procedure For Retrieving Your Work From The Server At The Start Of A Class . . . . . . . . . . . . . . . . . . . . . 17 2 Introduction to Matlab 20 2.1 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.2 A Quick Tour of Matlab . . . . . . . . . . . . . . . . . . 24 3 Matlab Basics 51 3.1 Interacting with Matlab . . . . . . . . . . . . . . . . . . 52 3.1.1 Command Entry . . . . . . . . . . . . . . . . . . . 52 3.1.2 Command Syntax and Variables . . . . . . . . . . 54 3.1.3 Variable Behaviour . . . . . . . . . . . . . . . . . . 56 3.1.4 Script Files . . . . . . . . . . . . . . . . . . . . . . 59 3.2 More Basics . . . . . . . . . . . . . . . . . . . . . . . . . . 61MS4024 Numerical Computation Part 1 Matlab 0-3 3.2.1 Help . . . . . . . . . . . . . . . . . . . . . . . . . . 64 3.2.2 Some Tips for Command Entry . . . . . . . . . . . 68 3.2.3 Some Points on Arithmetic . . . . . . . . . . . . . 70 3.2.4 Managing Variables . . . . . . . . . . . . . . . . . 73 3.2.5 Saving Variables to a File . . . . . . . . . . . . . . 75 3.2.6 Logging a Matlab Session . . . . . . . . . . . . . 80 3.2.7 The disp Command . . . . . . . . . . . . . . . . . 81 3.2.8 Automatic Storage Allocation . . . . . . . . . . . . 82 3.2.9 How Matlab Does Arithmetic . . . . . . . . . . . 86 3.3 An Example . . . . . . . . . . . . . . . . . . . . . . . . . 93 4 Matrices 103 4.1 Generating Matrices . . . . . . . . . . . . . . . . . . . . . 104MS4024 Numerical Computation Part 1 Matlab 0-4 4.1.1 Block Matrix Techniques . . . . . . . . . . . . . . 110 4.2 Subscripts and Colon Notation . . . . . . . . . . . . . . . 111 4.3 Matrix and Array Operations . . . . . . . . . . . . . . . . 120 4.3.1 Scalar Expansion . . . . . . . . . . . . . . . . . . . 130 4.4 Matrix Manipulation . . . . . . . . . . . . . . . . . . . . . 133 4.5 Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 138 5 Loops, If, etc. 146 5.1 Relational and Logical Operators . . . . . . . . . . . . . . 147 5.1.1 Testing Variables for complex in Matlab . . . . 153 5.1.2 Logical Operators in Matlab . . . . . . . . . . . . 154 5.1.3 \Short-Circuiting" . . . . . . . . . . . . . . . . . . 157 5.1.4 Finding Elements in Matrices . . . . . . . . . . . . 161MS4024 Numerical Computation Part 1 Matlab 0-5 5.2 Branching Commands . . . . . . . . . . . . . . . . . . . . 166 5.2.1 If/Then/Else . . . . . . . . . . . . . . . . . . . . . 167 5.2.2 For Loops . . . . . . . . . . . . . . . . . . . . . . . 170 5.2.3 While Loops, Break and Continue . . . . . . . . . 175 5.2.4 The Switch Statement . . . . . . . . . . . . . . . . 179 6 M-Files 182 6.1 Scripts and Functions . . . . . . . . . . . . . . . . . . . . 182 6.2 Function M-Files . . . . . . . . . . . . . . . . . . . . . . . 187 6.2.1 Passing Function Names as Parameters . . . . . . 204 6.3 Naming and Editing M-Files . . . . . . . . . . . . . . . . 209 6.4 The Matlab Path . . . . . . . . . . . . . . . . . . . . . . 210 6.5 Command/Function Duality . . . . . . . . . . . . . . . . . 215MS4024 Numerical Computation Part 1 Matlab 0-6 7 Plotting 219 7.1 Two-Dimensional Graphics . . . . . . . . . . . . . . . . . 220 7.1.1 Basic Plots . . . . . . . . . . . . . . . . . . . . . . 220 7.1.2 Axes and Annotation . . . . . . . . . . . . . . . . 240 7.1.3 Multiple Plots in a Single Figure . . . . . . . . . . 256 7.2 Three-Dimensional Graphics . . . . . . . . . . . . . . . . . 264 7.2.1 Contour Plots . . . . . . . . . . . . . . . . . . . . . 267 7.2.2 Surface Plots . . . . . . . . . . . . . . . . . . . . . 276 7.3 Saving and Printing Figures . . . . . . . . . . . . . . . . . 280 8 Linear Algebra 287 8.1 Norms and Condition Numbers . . . . . . . . . . . . . . . 289 8.2 Linear Equations . . . . . . . . . . . . . . . . . . . . . . . 295MS4024 Numerical Computation Part 1 Matlab 0-7 8.2.1 Square Systems . . . . . . . . . . . . . . . . . . . . 296 8.2.2 Overdetermined Systems . . . . . . . . . . . . . . . 300 8.2.3 Underdetermined Systems . . . . . . . . . . . . . . 303 8.3 Eigenvalue problems . . . . . . . . . . . . . . . . . . . . . 305 8.3.1 Eigenvalues . . . . . . . . . . . . . . . . . . . . . . 306 9 Input and Output 311 9.1 User Input . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 9.2 Output to the Screen . . . . . . . . . . . . . . . . . . . . 315 9.3 File Input and Output . . . . . . . . . . . . . . . . . . . . 322 10 Using Matlab Eciently 325 10.1 Vectorisation . . . . . . . . . . . . . . . . . . . . . . . . . 328 10.1.1 J.I.T. . . . . . . . . . . . . . . . . . . . . . . . . . 334MS4024 Numerical Computation Part 1 Matlab 0-8 10.2 Preallocating Arrays . . . . . . . . . . . . . . . . . . . . . 342 10.3 Miscellaneous Optimisations . . . . . . . . . . . . . . . . . 345 X Supplementary Material 347 A First Matlab Project for 10% 348 B Second Matlab Project for 15% 352 C Third Matlab Project for 25% 359 D More Examples 381MS4024 Numerical Computation Part 1 Matlab 1 ' 0 About the Course  This course is split into two main parts; Part 1 (on the Matlab mathematical programming package) and Part 2 (on the R statistical programming package) which will be taught by a Statistics lecturer. A  There will be a short introduction to LT X (a mathematical E document preparation package) in Week 2 or 3. A  The notes for the LT Xintroduction may be found at http: E //jkcray.maths.ul.ie/ms4024/LaTeX-Files/LaTeX.pdf  Part 1 will run in Weeks 17 (six weeks on Matlab , one on A LT X), E  Part 2 will run for six weeks in weeks 813 inclusive.  All classes will be held in C2-062. & %MS4024 Numerical Computation Part 1 Matlab 2 '  We meet for three hours per week.  All classes are designated labs, rather than lectures or tutorials.  Our labs will run from 13:0016:00 on Mondays.  Extra slots are available in C2-062 09:0012:00 Wednesdays.  These are the scheduled times from Week 8 on but are available from Week 1)  We'll use them when necessary once work starts on the projects.  Extra class time (outside normal lecture hours i.e. after 18:00) will be provided if necessary to complete projects. & %MS4024 Numerical Computation Part 1 Matlab 3 '  In Week 1, I will introduce you to Matlab using these Notes which you will work through on your PC (like the MS4101 Mathematics Laboratory module in Year 1).  From Week 3 on you will work on your projects in class with help from me when needed.  I'll continue to introduce new material from time to time as needed for the projects.  Once projects begin we will work on them in all three labs each week.  A record of attendance will be kept  In class you will learn how to use Matlab and be shown how to use it to solve increasingly challenging problems.  Approximately every two weeks starting in Week 3 you will be assigned a new task/project. & %MS4024 Numerical Computation Part 1 Matlab 4 '  To ensure that students get credit for their own work all project work will be done and submitted in class.  You will upload your work to a server at the end of every class and retrieve it at the beginning of the next.  The PC's in the lab are con gured by ITD to have the student folders wiped daily so you must upload your work to the server at the end of each class. & %MS4024 Numerical Computation Part 1 Matlab 5 '  You will work on the local C: drive, in the WorkArea folder.  You will not save your work to a usb stick.  You will use a folder named as your Student ID, in the WorkArea folder.  At the end of a class, navigate to the C:nWorkArea folder.  You will right click on the desktop (blank area) your personal folder (say 123456789) and choose the option Send to a zip le which creates a compressed (or zipped) le called (say)123456789.zip in the C:nWorkArea folder.  You will use the two links at the foot of the module web page: http://jkcray.maths.ul.ie/ms4024.html To upload your zip le at the end of a class. To retrieve your zip le at the start of a class.  Details in Ch. 1 below. & %MS4024 Numerical Computation Part 1 Matlab 6 '  You may and should work on your projects between tutorial classes but may not bring your work into class.  The module will be assessed by three assessments during the period of Part 1 (weighted as 10%, 15% and 25%).  There will be no end-of-semester assessment. & %MS4024 Numerical Computation Part 1 Matlab 7 ' 0.1 Lecture Notes  These notes (for Part 1) are available in printed form from the U.L. Print Room Ref 5808, priceE6.00.  And may be downloaded from http://jkcray.maths.ul.ie/ms4024/M-Slides.pdf.  You may also download other material including example Matlab les and material for LaTeX and for Part 2 from http://jkcray.maths.ul.ie/ms4024.html. & %MS4024 Numerical Computation Part 1 Matlab 8 ' 0.2 Module Description/Syllabus  The Matlab language: Introduce Matlab command syntax; Matlab workspace, arithmetic, number formats, variables, built-in functions. Using vectors in Matlab; colon notation. Arrays; array indexing, array manipulation. Two-dimensional graphics; basic plots, axes, multiple plots in a single gure, saving and printing gures. Matlab commands in \batch" mode; script M- les, saving variables to a le, the diary function. & %MS4024 Numerical Computation Part 1 Matlab 9 ' Relational and logical operations; testing for equality/inequality, and/or/not. Control ow: for, while, if/else, case, try/catch. Function M- les: parameter passing mechanisms, global and local variables.  Applications of Matlab; topics to be taken from: Numerical Linear Algebra; norms and condition numbers, solution of linear equations, inverse, pseudo-inverse and determinant, LU and Cholesky factorisations, QR factorisation, Singular Value Decomposition, eigenvalue problems. Polynomials and data tting. Nonlinear equations and optimisation. Numerical solution of ordinary di erential equations. & %MS4024 Numerical Computation Part 1 Matlab 10 ' 0.3 Learning Outcomes Learning Outcome Assessment Mode Use Matlab in command mode to per- Lab sessions with form simple numerical and matrix com- submitted report. putations and to generate graphical output. Construct Matlab script M- les to per- Lab sessions with form vector, matrix and general numer- submitted script ical computations. le and submitted report. Design and code a set of Matlab func- Lab sessions with tion M- les to solve an Applied Mathe- submitted function matics problem (see Syllabus). M- les and submit- ted report. & %MS4024 Numerical Computation Part 1 Matlab 11 ' 0.4 Recommended Texts In addition to these notes, the following books are useful as references. 1. Mastering Matlab 7, D. Hanselman and B. Little eld, Pearson Education N.J. 2005, ISBN 0131857142, U.L. Library Link. 2. Matlab Guide D.J. Higham & N.J. Higham, SIAM Philadelphia, 2005, ISBN 0898715784, U.L. Library Link. 3. Numerical Computing with MATLAB, Cleve B. Moler, Cambridge University Press, 2004. ISBN 0898715601. 4. Matlab Primer, T. A. Davis, K. Sigmon, CRC Press, 2005. ISBN 1584885238. 5. See also the link http://jkcray.maths.ul.ie/ms4327.html for a list of on-line introductions to Matlab. & %

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.