matbasics - MATLAB 7.0 Basics P. Howard Spring 2005...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
MATLAB 7.0 Basics P. Howard Spring 2005 Contents 1 Introduction 2 2 Starting MATLAB at Texas A&M University 2 3 Simple Computations with MATLAB 3 3 . 1 Wh a ty ou r el ook in ga t........................................ 3 3 . 2 B a s i cC ompu t a t i on s ......................................... 3 3 . 2 . 1 A r rayOp e ra t i s....................................... 4 3 . 3 B a s i cA l g eb ra. ............................................ 4 3 . 3 . 1 S o lv gA l g i cEqu a t i sinMATLAB. ........................ 5 3.3.2 The Subs Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.3.3 Inline Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.4 Basic Calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3 . 4 . 1 D iff e r en t i a t i on . ....................................... 7 3.4.2 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3 . 4 . 3 L im i t s............................................. 8 3 . 4 . 4 Sum sandP rodu c t s ..................................... 9 3 . 4 . 5 T ay l o rs e r i e 9 3.4.6 Maximization and Minimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3 . 5 M -F i l e s ................................................ 10 3 . 5 . c r ip tM i l e s ........................................ 3 . 5 . 2 W o rk ginS c r -fi l e s .................................. 11 3 . 5 . 3 F un c t i onM l e s ....................................... 12 3 . 5 . 4 D ebu gg gM l e s ...................................... 13 3 . 6 F i l eM an ag em tf romMATLAB. ................................. 3.7 The Command Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3 . 8 Th eC omm andH i s t o ry. 3 . 9 Th eMATLABW o sp a c e...................................... 4 Plots and Graphs in MATLAB 14 4.1 Simple x y P l o t s........................................... 14 4 . 2 P l o t t gF c t i s .......................................... 15 4 . 2 . 1 P l o t t gfun c t i sw i thth ep l o tc and. 4 . 2 . 2 E zp l o t............................................. 16 4 . 3 Jux t apo s gOn eP l o tOnT opo fAn o th e r............................. 17 4.4 Multiple Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.5 Plotting Functions of Multiple Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4 . 5 . 1 C t rP l o t s......................................... 18 4 . 6 S av gP l o t sa sEn c ap su l a t edP o s t s c r tF i l e s........................... 5 Matrices 19 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Programming in MATLAB 20 6 . 1 Ov e rv i ew . .............................................. 20 6 . 2 L oop s ................................................. 6 . 2 . 1 Th eF o rL oop. ........................................ 6.2.2 The While Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 6.3 Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 6 . 3 . 1 I f -E l s eS t a t em en t s ...................................... 21 6 . 3 . 2 Sw i t chS t a t t 22 6.4 Subfunctions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.5 Input and Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.5.1 Parsing Input and Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6 . 5 . 2 S c r e enOu tpu t ........................................ 23 6.5.3 Screen Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 6.5.4 Screen Input on a Figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 7 Miscellaneous Useful Commands 24 8 Graphical User Interface 24 9 SIMULINK 25 10 M-book 25 11 Useful Unix Commands 25 11 . 1C r e a t in gUn ixC omm and s...................................... 25 . 2M o r eH e lponUn ix. ......................................... 26 12 FAQs 26 1 Introduction MATLAB, which stands for MATrix LABoratory, is a software package developed by MathWorks, Inc. to facillitate numerical computations as well as some symbolic manipulation. 1 It strikes me as being slightly more difficult to begin working with than such packages as Maple, Mathematica, and Macsyma, though once you get comfortable with it, it offers greater flexibility. The main point of using it in M442 is that it is currently the package you will most likely find yourself working with if you get a job in engineering or industrial mathematics. 2 Beyond these notes (and other class hand-outs), I can suggest three useful resources for help with MAT- LAB: 1. the references listed at the end of these notes, the best of which for our purposes is probably the short book by Gilat, 2. MATLAB’s extensive built-in help, which you can access from the MATLAB prompt with the command helpdesk , and 3. the Calclab help sessions in which you can typically find at least one or two people who not only know MATLAB but have been through this modeling course.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/13/2011 for the course CRYPTO 101 taught by Professor Na during the Spring '11 term at Harding.

Page1 / 28

matbasics - MATLAB 7.0 Basics P. Howard Spring 2005...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online