1 / 20

Matlab

Matlab. http://www.mathworks.com/academia/student_version/doc_r14.html Cost: $100 Available in labs on Windows and Unix machines. What is Matlab?.

diamond
Download Presentation

Matlab

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Matlab http://www.mathworks.com/academia/student_version/doc_r14.html Cost: $100 Available in labs on Windows and Unix machines.

  2. What is Matlab? • high-performance language for technical computing. It integrates computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation.

  3. Uses • Math and computation • Algorithm development • Data acquisition • Modeling, simulation, and prototyping • Data analysis, exploration, and visualization • Scientific and engineering graphics • Application development, including graphical user interface building

  4. Basic Idea • Particularly useful for problems that can be cast into matrix, vector form • MATLAB=Matrix Laboratory • Starting matlab • Windows: double click on icon • Unix: type matlab at the prompt

  5. Basics: Matlab • Use as a calculator • No compiling • Interactive or through an .m script • Direct access to the variables in memory: who? • Syntax • Set work directory for m scripts.

  6. Enter Matrices • Enter an explicit list of elements. • Load matrices from external data files. • Generate matrices using built-in functions. • Create matrices with your own functions in M-files.

  7. Durer’s matrix example • Page 4-3 • How to enter matrix • Matlab has built in function to manipulate matrix • Sum • Diag • Tranpose with prime • Subsripts use • Acces individual matrix elements

  8. Expressions • “Variables” on page 4-10 • “Numbers” on page 4-11 • “Operators” on page 4-11 • “Functions” on page 4-12

  9. Variables and numbers • Examples of number Integer, real: 3 -99 0.0001 Scientific: 9.6397238 1.60210e-20 6.02252e23 Imaginary: 1i -3.14159j 3e5i • Like any other language matlab can assign variables and change them • N=32; M=N etc…..

  10. Operators • + Addition • - Subtraction • * Multiplication • / Division • \ Left division (described in “Matrices and LinearAlgebra” in the MATLAB documentation) • ^ Power • ' Complex conjugate transpose • ( ) Specify evaluation order

  11. Functions • Many functions avaliable • Sin,cos, tan • Exp • Bessel • Help elfun • Help specfun • Help elmat

  12. Working with Matrices • “Generating Matrices” on page 4-14 • “The load Function” on page 4-15 • “M-Files” on page 4-15 • “Concatenation” on page 4-16 • “Deleting Rows and Columns” on page 4-17

  13. Linear Algebra • A=A+A’ • Determinant: det(A) • Inverse: inv(A) • Eigenvalue eig(A) • Matrix-vector produce • V=ones(4,1) • A*v

  14. Arrays • + Addition • - Subtraction • .* Element-by-element multiplication • ./ Element-by-element division • .\ Element-by-element left division • .^ Element-by-element power • .' Unconjugated array transpose

  15. Graphics • very important for visualization of results: not available in any other tool. • help graphics • plot opens in figure • edit with gui (5-15 and further) • subplot • plot to file

  16. Basic plotting functions • “Creating a Plot” on page 5-38 • “Multiple Data Sets in One Graph” on page 5-40 • “Specifying Line Styles and Colors” on page 5-41 • “Plotting Lines and Markers” on page 5-41 • “Imaginary and Complex Data” on page 5-43 • “Adding Plots to an Existing Graph” on page 5-44 • “Figure Windows” on page 5-46 • “Multiple Plots in One Figure” on page 5-46 • “Controlling the Axes” on page 5-48 • “Axis Labels and Titles” on page 5-49 • “Saving Figures” on page 5-51

  17. Mesh and surface plots • Will be used in this class • Meshes are required for numerical computations. • meshgrid: transforms the domain specified by a single vector or two vectors x and y into matrices X and Y for use in evaluating functions of two variables.

  18. Progamming • “if” on page 6-2 • “switch and case” on page 6-4 • “for” on page 6-5 • “while” on page 6-6 • “continue” on page 6-6 • “break” on page 6-7

  19. Animations • matlabinto_anim.m

More Related