1 / 29

MATLAB TUTORIAL

MATLAB TUTORIAL. Matlab Basics. Purpose of this Section. To illustrate simple uses of the MATLAB Technical language To help you understand under what circumstances is MATLAB a better choice than spreadsheets and high-level languages. What is MATLAB?.

satchley
Download Presentation

MATLAB TUTORIAL

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 TUTORIAL Matlab Basics

  2. Purpose of this Section • To illustrate simple uses of the MATLAB Technical language • To help you understand under what circumstances is MATLAB a better choice than spreadsheets and high-level languages

  3. What is MATLAB? • A high-performance language for technical computing (Mathworks, 1998) • Typical uses of MATLAB Mathematical computations Algorithmic development Model prototyping (prior to complex model development) Data analysis and exploration of data (visualization) Scientific and engineering graphics for presentation

  4. Why Matlab? • Because it simplifies the analysis of mathematical models • It frees you from coding in high-level languages (saves a lot of time - with some computational speed penalties) • Provides an extensible programming/visualization environment • Provides professional looking graphs

  5. Foundation of Matlab • The name is derived from MATrix LABoratory • MATLAB is a case sensitive language (a variable named “c” is different than another one called “C”) • MATLAB works with matriceseverything MATLAB understands is a matrix (from text to large cell arrays and structure arrays) • Various data types exist within MATLAB - single precision - double precision - integer (8 bit)

  6. The Matlab Environment

  7. MATLAB has the following basic window components: • Work-space Displays all the defined variables. • Command Window To execute commands in the MATLAB environment • Command History Displays record of the commands used

  8. Command Window

  9. Command Window (Contd..) • The command window allows you to interact with MATLAB just as if you type things in a calculator • Cut and paste operations ease the repetition of tasks • Use ‘up-arrow’ key to repeat commands (command history)

  10. Launch Pad

  11. Launch Pad (Contd…) • The launch window allows you to quickly select among various MATLAB components and toolboxes

  12. Matlab Workspace

  13. Workspace(Contd…) • Workspace of Matlab shows all the defined variables along with their “order”, memory space they occupy and the class to which they belong • Above are shown a few such variables

  14. Current Directory

  15. Current Directory (Contd…) • Provides quick access to all files available in your Path • Provides a brief description (when files are commented out) of each M-file

  16. Different Views

  17. Different Views (Contd…) • The Matlab environment could be viewed in various ways. • This could be accomplished by the VIEW pull-down menu as shown in the previous slide.

  18. Matlab Help

  19. Matlab Help (Contd..) • Matlab Help is an extremely powerful assistance to learn Matlab. • The Help not only contains the theoretical background but also shows the demos for implementation • The Matlab Help could be opened by using the HELP pull-down menu

  20. Matlab Help (Contd..)

  21. Matlab Help (Contd..) • Any command description can be found by typing the command in the search field. • As shown above the command to take square root (sqrt) is searched • We can also utilize the Matlab help from the command window as shown in the next slide.

  22. Matlab Help (Contd..)

  23. To begin a new M-file

  24. How the source-code looks like

  25. The Whos Command

  26. Scalar Calculation

  27. Vector Calculation

  28. Matrix Calculation

  29. Thank You

More Related