1 / 16

Introduction to write programs in MATLAB

Introduction to write programs in MATLAB. Ecological Modeling Course Sep 25, 2006. Review for the last class. Introduction to the Programming environment (a) MATLAB windows (b) Data types (c) Input and Output data. Technical route. Input. Output. Central Model. Scalar Vector Matrix.

laura-kane
Télécharger la présentation

Introduction to write programs in 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. Introduction to write programs in MATLAB Ecological Modeling Course Sep 25, 2006

  2. Review for the last class • Introduction to the Programming environment (a) MATLAB windows (b) Data types (c) Input and Output data

  3. Technical route Input Output Central Model • Scalar • Vector • Matrix • Scalar • Vector • Matrix • Equations • Algorithm Forward analysis

  4. Data input • Assignment statement: e.g. A=6; B=[1; 2; 3; 4; 5; 6; 7; 8; 9]; C=[1 2 3; 4 5 6; 7 8 9];

  5. Data output: • Plot statement: e.g. plot(x,y);title(‘example’);xlabel(‘x axis’);ylabel(‘y axis’);

  6. Central programs: Conceptual model Mathematical equations Computer language

  7. (a) Simple calculation • Add • Subtract • Multiply • Divide

  8. Example I: • Simple equations

  9. (b) Conditional statement

  10. Example II: • Discontinuous function

  11. Example III: Photosynthesis rate

  12. (c) Repetition statement

  13. Example IV: • Fibonacci number 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, …… Number 1000 =

  14. Example V: • Differential equation

  15. Homework: Based on Equation (3.1) and (3.2) (Page 5) & initial values in Figure 2 legend (Page 8) • Develop two-species model to simulate species abundance dynamics and Generate figure 2

More Related