Presentation is loading. Please wait.

Presentation is loading. Please wait.

A L I MAM M OHAMMAD B IN S AUD I SLAMIC U NIVERSITY C OLLEGE OF S CIENCES D EPARTMENT OF M ATHEMATICS MATLAB 251 : MATH SOFTWARE Introduction to MATLAB.

Similar presentations


Presentation on theme: "A L I MAM M OHAMMAD B IN S AUD I SLAMIC U NIVERSITY C OLLEGE OF S CIENCES D EPARTMENT OF M ATHEMATICS MATLAB 251 : MATH SOFTWARE Introduction to MATLAB."— Presentation transcript:

1 A L I MAM M OHAMMAD B IN S AUD I SLAMIC U NIVERSITY C OLLEGE OF S CIENCES D EPARTMENT OF M ATHEMATICS MATLAB 251 : MATH SOFTWARE Introduction to MATLAB

2 Aims 1. To present the software 2. To introduce elementary operations and functions. 3. To manipulate 2D and 3D graphics. 4. To introduce the notion of “files” and “programming”.

3 I NTRODUCTION TO M ATLAB 1. First Steps in MATLAB 1.1 What is MATLAB MATLAB (MATrix LABoratory ) is a very powerful and interactive software package optimized for scientific computation and, in Manipulation. particular, matrices With MATLAB we can Ø do mathematics and computation, Ø analyze data, Ø develop algorithms, Ø do simulation and modeling, Ø produce graphical displays and graphical user interfaces.

4 MatLab Programmin g Language External Interface (Mex-files) Interface with C, Java and Fortran Programs MATLAB Built-in Functions User-written Function Graphics 2-D Graphics 3-D Graphics Color and Lighting Animation Audio and Video Computations Linear Algebra Data Analysis Signal Processing Polynomials &Interpolation Quadrature Solution of ODEs * Image Processing * Splines * Robust Control * M-Analysis &synthesis * Optimization * Financial AND MANY MORE * Signal processing * Statistics * Control System * System Identification * Neural Networks * Communications * Symbolic Mathematics Toolboxes (Collections of specialized Function)

5 I NTRODUCTION TO M ATLAB 1. MATLAB is an interpreted language (code is compiled each time it is run. 2. MATLAB is easy to use (Mathematical operations) and has a complete documentation online. 3. MATLAB is Excellent for manipulating large amounts of tabular data (arrays, matrices) in a consistent way. 4. MATLAB has excellent visualization tools (plotting data and functions) 5. MATLAB has Lots of built-in functions for applied mathematics such data analysis, interpolation, linear algebra, Fourier analysis,… 6. MATLAB has many toolboxes (statistical, financial, symbolic,…) 7. MATLAB is a good programming language. 8. MATLAB allows to do numerical simulation based on numerical analysis algorithms. 9. MATLAB allows interfacing with programs in other language (C, Fortran, …).

6 I NTRODUCTION TO M ATLAB 1.2 Short History ( http://en.wikipedia.org/wiki/MATLAB ) MATLAB was invented in the late 1970s by Cleve Moler, then chairman of the computer science department at the University of New Mexico. He designed it to give his students access to LINPACK and EISPACK without having to learn Fortran. It soon spread to other universities and found a strong audience within the applied mathematics community. Jack Little, an engineer, was exposed to it during a visit Moler made to Stanford University in 1983. Recognizing its commercial potential, he joined with Moler and Steve Bangert. They rewrote MATLAB in C and founded The Math Works in 1984 to continue its development. These rewritten libraries were known as JACKPAC. MATLAB was first adopted by control design engineers, Little's specialty, but quickly spread to many other domains. It is now also used in education, in particular the teaching of linear algebra and numerical analysis, and is popular amongst scientists involved with image processing.

7 I NTRODUCTION TO M ATLAB 1.3 What is MATLAB useful references Full documentation available online in HTML and PDF format. http://www.mathworks.com/access/helpdesk/help/helpdesk.html Many documents on the web (http://www.google.com.sa)http://www.google.com.sa Notice: there are many freeware/sharewares similar to MATLAB. For instance SCILAB (http://www-rocq.inria.fr/scilab ) Read “Getting Started” section of the MATLAB manual

8 I NTRODUCTION TO M ATLAB 1.4 How to run MATLAB  To run MATLAB on a PC double-click on the MATLAB icon on the desktop.  To run MATLAB on a Unix system, Type MATLAB at the prompt. When MATLAB starts, a window appears (MATLAB Desktop) containing three smaller windows of different size: 1.The Command Window, 2.The Current Directory Window, and 3.The Command History Window. In the command window you should see a message: To get started, select MATLAB Help or Demos from the Help Menu. >>

9 I NTRODUCTION TO M ATLAB >> >>playbackdemo(‘desktop’) >>playbackdemo(‘historywindow’) >>playbackdemo(‘currdirectory’) >>playbackdemo(‘helpwindow’) Command Windows Curry directory >> MATLAB Prompt Tells that MATLAB is ready for your Command helpdesk lookfor matrix Lookfor diagonaliation Lookfor diadonal Lookfor spectrum Lookfor series Las=3 home Command History

10 I NTRODUCTION TO M ATLAB PurposeWindows Main windows, enter variables and commands, runs programs,… Command Windows Logs commands entered in the Command Window Command History Window Shows the files in the current repertoryCurrent Directory Window Contains output from the graphic commandsFigure Window Creates and debugs script and functions filesEditor Window Provides help informationHelp Window Improve the performance of your M-files is using profiling tools Profiler Window Provides information about the variables that are used Workspace Window

11 I NTRODUCTION TO M ATLAB SIMULINK HELP OPEN FILES NEW FILE

12 I NTRODUCTION TO M ATLAB 1.5 How to quit MATLAB To end a MATLAB session type quit or exit at the MATLAB prompt. Click on the symbol on the upper right of the MATLAB window. In the command window:  To type commands the cursor must be placed after the command prompt ( >> ).  Once the command typed, you have to press the “enter” key for executing the command.  You can type many commands on the same line separated between them by a comma (, ). X

13 I NTRODUCTION TO M ATLAB >> Command Window 39*4.4+5 ans = 176.6000 The MATLAB command THE RESULT

14 I NTRODUCTION TO M ATLAB 1.6 Help me MATLAB! To get started, type one of these commands:  help: Opens a MATLAB help at the prompt.  helpwin: Opens a MATLAB help GUI  helpdesk: Opens a MATLAB hypertext help browser  demo(s): Starts the MATLAB demonstration You can click on the icon on the MATLAB window ?  You can learn how to use any MATLAB command by typing help followed by the name of the command, for example >> help sin.  You can also use the lookfor command, which searches the help entries for all MATLAB commands for a particular word. you could type >> lookfor inverse. MATLAB responds with the names of the commands that have the searched word in the first line of the help entry. You can search the entire help entry for all MATLAB commands by typing >> lookfor –all inverse.

15 I NTRODUCTION TO M ATLAB REMARK on the “HELP” command For example, help solve will display documentation for solve. Unless you have a large monitor, the output of help solve will not fit in your MATLAB command window, and the beginning of the documentation will scroll quickly past the top of the screen. You can force MATLAB to display information one screenful at a time by typing more on. You press the space bar to display the next screenful, or ENTER to display the next line; type help more for details. Typing more on affects all subsequent commands, until you type more off.


Download ppt "A L I MAM M OHAMMAD B IN S AUD I SLAMIC U NIVERSITY C OLLEGE OF S CIENCES D EPARTMENT OF M ATHEMATICS MATLAB 251 : MATH SOFTWARE Introduction to MATLAB."

Similar presentations


Ads by Google