150 likes | 467 Views
Introduction to MATLAB 7. Engineering 161 Engineering Practices II Joe Mixsell February 1 2006. MATLAB Properties I. MATLAB is a very powerful mathematical computational tool. MATLAB comes from MAT rix LAB oratory MATLAB provides extensive capabilities for generating graphs
E N D
Introduction to MATLAB 7 Engineering 161 Engineering Practices II Joe Mixsell February 1 2006
MATLAB Properties I • MATLAB is a very powerful mathematical computational tool. • MATLAB comes from MATrix LABoratory • MATLAB provides extensive capabilities for generating graphs • MATLAB is applicable to a broad range of engineering problems
MATLAB Properties II • MATLAB supports an interactive and a programming environment • Think of the interactive environment as a “super calculator” with graphics • Think of the programming environment as tool for writing programs to perform complex calculations
MATLAB Properties III • Where does MATLAB fit? • It is usually easier to write programs in MATLAB as compared to C or Fortran • C or Fortran programs will usually run faster than MATLAB programs • But, MATLAB is optimized for matrix manipulations and programs formalized in this way will run faster than similar programs in C or Fortran
Resources • Text: Introduction to MATLAB 7 • Notes: MATLAB Notes and Assignments • Website: www.engr.uaa.alaska.edu/soe/courses/engr161/ • Website: www.mathworks.com • Student Edition of MATLAB 7 • Computer Lab
Course of Study • MATLAB Environment Chp. 2 • Predefined MATLAB functions Chp. 3 • Plotting Chp. 4 • Programming in MATLAB Chp. 5 • Matrix Computations Chp. 6 • Symbolic Mathematics Chp. 7
MATLAB Assignments • Chp. 2: 2.1, 2.2, 2.5, 2.6, 2.10, 2.12 • Chp. 3: 3.1, 3.4, 3.7, 3.8, 3.9, 3.11 • Chp. 4: 4.1, 4.2, 4.5, 4.7, 4.9a, 4.9b • Chp. 5: 5.1, 5.2, 5.5 • Chp. 6: 6.3, 6.6, 6.8, 6.9, 6.11 • Chp. 7: 7.1, 7.3, 7.4, 7.5, 7.7, 7.9, 7.10, 7.11, 7.12
Assignments • The percent symbol % is used to define a comment, use this following the MATLAB prompt to add your name and assignment number to your work >>% Joe Mixsell >>% Assignment 3.4
More on Assignments • The first few assignments can easily be done with paper and pencil but you need to do them using MATLAB. Only outputs from MATLAB will be accepted.
An Engineering Problem-Solving Methodology • Step 1: State the problem clearly. • Step 2: Describe the inputs and outputs. • Step 3: Work the problem by hand with a set of simple data. • Step 4: Develop the MATLAB solution • Step 5: Test the solution with real data
Getting Started Example 1 (Prob. 2.10) d = ½ * g * t^2 where d is the distance a body falls freely in a gravitation field during t seconds. Example 2 (Assignment 3) x(t) = exp (-alpha * t ) * sin ( omega * t ) i.e, our suspension system we studied previously using Excel
Example 1 • Using MATLAB we want to create table of values of time and distance for time increments between 0 and 10 seconds.
Example II • Using MATLAB we’ll redo the analysis of our suspension system to compare the two approaches to solving this problem.
Today’s Discussion • Introduce various MATLAB windows • Use the Command Window • Use the Edit Window • View results in the Command Window and the Graphics Window