Basics of MATLAB By DR. Wafaa Shabana

Slides:



Advertisements
Similar presentations
MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
Advertisements

Introduction to Matlab
Introduction to Matlab Workshop Matthew Johnson, Economics October 17, /13/20151.
MATLAB – What is it? Computing environment / programming language Tool for manipulating matrices Many applications, you just need to get some numbers in.
Introduction to MATLAB 3 November Instructor: Andy Newman Office Hours: Stop by room 306 (main building) whenever
Introduction to Array The fundamental unit of data in any MATLAB program is the array. 1. An array is a collection of data values organized into rows and.
Introduction to Matlab Jianguo Wang CSSCR September 2009.
Digital Image Processing Lecture3: Introduction to MATLAB.
What is MATLAB ? MATrix LABratory –Originally, it was a front-end to FORTRAN matrix routines developed in the U. of New Mexico and Stanford –Today.
MATLAB and SimulinkLecture 11 To days Outline  Introduction  MATLAB Desktop  Basic Features  Branching Statements  Loops  Script file / Commando.
259 Lecture 15 Introduction to MATLAB. 2 What is MATLAB?  MATLAB, which stands for “MATrix LABoratory” is a high- performance language for technical.
MATLAB Lecture One Monday 4 July Matlab Melvyn Sim Department of Decision Sciences NUS Business School
MATLAB INTRO CONTROL LAB1  The Environment  The command prompt Getting Help : e.g help sin, lookfor cos Variables Vectors, Matrices, and Linear Algebra.
1 Statistical Computing in MATLAB AMS 597 Ling Leng.
Martin Ellison University of Warwick and CEPR Bank of England, December 2005 Introduction to MATLAB.
Nonparametric Econometrics1 Intro to Matlab for Data Analysis and Statistical Modeling.
Introduction to MATLAB Session 1 Prepared By: Dina El Kholy Ahmed Dalal Statistics Course – Biomedical Department -year 3.
You can make this in matlab!. Matlab Introduction and Matrices.
MATLAB Tutorials Session I Introduction to MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU.
Introduction to M ATLAB EE 100 – EE Dept. - JUST.
Introduction to Matlab 1. Outline: What is Matlab? Matlab Screen Variables, array, matrix, indexing Operators Plotting Flow Control Using of M-File Writing.
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
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.
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
1 Lab of COMP 406 Teaching Assistant: Pei-Yuan Zhou Contact: Lab 1: 12 Sep., 2014 Introduction of Matlab (I)
A brief introduction to MATLAB for students of Science, Engineering and Mathematics Jorge Lemagne Bindura University.
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
A Brief Introduction to Matlab Laila Guessous Dept. of Mechanical Engineering Oakland University.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
MATLAB Tutorial EE 327 Signals and Systems 1. What is MATLAB? MATLAB – Matrix Laboratory The premier number-crunching software Extremely useful for signal.
Eng Ship Structures 1 Introduction to Matlab.
INTRODUCTION TO MATLAB LAB# 01
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation tools. Others include Maple Mathematica MathCad.
Matlab The language of Technical computing Mr. D. Suresh Assistant Professor, Dept. of CSE, PSNA CET, Dindigul.
Matlab 14.html Cost: $100 Available in labs on Windows and Unix machines.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Introduction to Matlab. Outline:  What is Matlab? Matlab Screen Variables, array, matrix, indexing Operators (Arithmetic, relational, logical ) Display.
Chapter 1 – Matlab Overview EGR1302. Desktop Command window Current Directory window Command History window Tabs to toggle between Current Directory &
Introduction to Matlab. What is Matlab? A software environment for interactive numerical computations Examples:  Matrix computations and linear algebra.
INTRODUCTION TO MATLAB MATLAB is a software package for computation in engineering, science, and applied mathemat-ics. It offers a powerful programming.
Matlab Screen  Command Window  type commands  Current Directory  View folders and m-files  Workspace  View program variables  Double click on a.
MATLAB Tutorial EE313 Signals and Systems Created: Thursday Jan 25, 2007 Rayyan Jaber Modified by: Jeff Andrews.
BOĞAZİÇİ UNIVERSITY DEPARTMENT OF MANAGEMENT INFORMATION SYSTEMS MATLAB AS A DATA MINING ENVIRONMENT.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
INTRODUCTION TO MATLAB Dr. Hugh Blanton ENTC 4347.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
An Introduction to Programming in Matlab Emily Blumenthal
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
MATLAB ……………….matrix laboratory. Bhushan D Patil PhD Research Scholar Department of Electrical Engineering Indian Institute of Technology, Bombay Powai,
ECE 1304 Introduction to Electrical and Computer Engineering
Introduction to MATLAB
Computer Application in Engineering Design
Introduction to Mat lab
L – Modeling and Simulating Social Systems with MATLAB
Statistical Computing in MATLAB
Welcome to MATLAB.
Outline Matlab tutorial How to start and exit Matlab Matlab basics.
INTRODUCTION TO BASIC MATLAB
MATLAB DENC 2533 ECADD LAB 9.
Matlab Workshop 9/22/2018.
StatLab Matlab Workshop
Use of Mathematics using Technology (Maltlab)
StatLab Workshop: Intro to Matlab for Data Analysis and Statistical Modeling 11/29/2018.
Digital Image Processing
Communication and Coding Theory Lab(CS491)
Matlab Basic Dr. Imtiaz Hussain
Introduction to Matlab
Presentation transcript:

Basics of MATLAB By DR. Wafaa Shabana Email: wrs_coms@yahoo.com

Table of Contents: 1. What is MATLAB? 2. Why MATLAB? 3. Is MATLAB a compiled language? 4. MATLAB toolboxes. 5. How to start and quit MATLAB? 6. MATLAB command window. 7. Getting starting with MATLAB. 8. Graphs 9. Questions 10. References

1.What is MATLAB? MATLAB is a 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. MATLAB is one of the fastest and most enjoyable ways to solve problems numerically.

1. What is MATLAB?(continued) MatLab : Matrix Laboratory Numerical Computations with matrices Every number can be represented as matrix Matlab is an interactive program for numerical computation and data visualization; MATLAB is a product of The MathWorks, Inc. - The MathWorks is the leading developer of mathematical computing software for engineers and scientists since 1984.

2. Why MATLAB? Main Features Simple programming rules Extended accuracy Comprehensive mathematical library Extensive graphics tools for 2D and 3D graphics Linkages with other languages Transportability across environment MATLAB scripts will work on PC, UNIX, Mac

2. Why MATLAB? (continued) Mathematical functions for linear algebra, statistics, Fourier analysis, filtering, optimization, and numerical integration 2-D and 3-D graphics functions for visualizing data Tools for building custom graphical user interfaces Functions for integrating MATLAB based algorithms with external applications and languages, such as C, C++, Fortran, Java™, COM, and Microsoft® Exce

2. Why MATLAB? (continued) MATLAB is useful for visualization and data analysis MATLAB is versatile, designed to work the same across platforms and to interface with multiple programming languages MATLAB is expandable with toolboxes User Friendly (GUI) Easy to work with Powerful tools for complex mathematics Note that: With the MATLAB language, you can program and develop algorithms faster than with traditional languages because you do not need to perform low-level administrative tasks, such as declaring variables, specifying data types, and allocating memory.

3. Is MATLAB a compiled language? MATLAB is an interpreted language It is not a compiled language Question: 1- What is the difference between a compiled and interpreted language? Give an example for each.

4. MATLAB toolboxes: Signal Processing toolbox Image processing toolbox Database toolbox Wavelets toolbox Partial Differential equation toolbox Fuzzy logic Neural Network toolbox Financial toolbox Communications toolbox Bioinformatics toolbox Statistics toolbox Optimization toolbox

5. How to start MATLAB? On Microsoft Windows® platforms, start the MATLAB program by double-clicking the MATLAB shortcut on your Windows desktop. On Apple® Macintosh® platforms, start MATLAB by double-clicking the MATLAB icon in the Applications folder. On UNIX® platforms, start MATLAB by typing matlab at the operating system prompt.

6. MATLAB command window: Main window in MATLAB Commands entered here MATLAB displays >> prompt when ready for a command Will have no >> prompt when processing commands

Workspace Window Workspace Window Shows all currently defined variables Array dimensions Min, max values Good debugging tool

Command History Command History Shows all past commands Can copy and past commands into command window Double click will execute command

7. Getting Started with MATLAB: MATLAB is case sensitive Variable ‘ans’ will take value of result of command if no equal sign specified Holds most recent result only Semicolon at end of line will suppress output, it is not required like in C or C++ Useful in script files and debugging

7.1 Mathematical operators: Scalar arithmetic operations Operation MATLAB form Exponentiation: ^ ab a^b Multiplication: * ab a*b Right Division: / a / b = a/b a/b Left Division: \ a \ b = b/a a\b Addition: + a + b a+b Subtraction: - a – b a-b e.g 2^6*3+4-6 =(( ((2^6)*3)+4)-6)

7.2 Logical operators:

7.3 MATLAB help: Ways to get help in MATLAB help function name Provides basic text output Type helpwin on command line Look under the help menu on the desktop

7.3 MATLAB help: lookfor keyword command will also find functions that have the keyword in them doc function_name brings up the full documentation for the function

7.4 Matrices in MATLAB: You can enter matrices into MATLAB in several different ways: 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.

As a list of its elements: Separate the elements of a row with blanks or commas. Use a semicolon, ; , to indicate the end of each row. Surround the entire list of elements with square brackets, [ ]. simply type in the Command Window A = [16 3 2 13; 5 10 11 8; 9 6 7 12; 4 15 14 1]

The element in row i and column j of A is denoted by A(i,j). Some basic functions for matrices: sum(A) A‘: transpose (A) diag(A), inv(A), ones(N), zeros(N), A*B, A.*B

The Colon Operator: The colon, :, is one of the most important MATLAB operators. It occurs in several different forms. For example: 1:10 To obtain non-unit spacing, specify an increment. 100:-7:50 and 0:pi/4:pi

Subscript expressions involving colons refer to portions of a matrix: A(1:k,j) is the first k elements of the jth column of A. A(: , i) All elements in the ith column

8. Graphs t = 0:pi/20:2*pi; y = exp(sin(t)); plotyy(t,y,t,y,'plot','stem') xlabel('X Axis') ylabel('Plot Y Axis') title('Two Y Axes') % comment % plotyy :2-D line plots with y-axes on both left and right side

Subplots You can place more than one plot on a figure using the subplot function. The function takes three arguments. subplot(n_rows, n_cols, which_plot) n_rows and n_cols serve to divide the figure into fields. The fields are numbered from left to right and then up to down. which_plot tells which field to place a plot.

>> x=0:0.002:100; y1=log(x+1); y2=cos(x); y3=sin(x); y4 = 10*x+5; >> subplot(2,2,1) >> plot(x,y1), title('y=log(x+1)') >> subplot(2,2,2) >> plot(x,y2), title('y=cos(x)') >> subplot(2,2,3) >> plot(x,y3), title('y=sin(x)') >> subplot(2,2,4) >> plot(x,y4), title('y=10x+5') figure plot(x(1:20000),y2(1:20000))

9. Questions? What is an OSS? Is MATLAB an OSS? Give an example of an OSS? Further Questions:

10. References: You can read the following references: 1- “The Basics of MATLAB” Jeffrey O. Bauer 2- www.mathworks.com 3. “MATLAB tutorial for beginners” Jyotirmay Gadewadikar http://arri.uta.edu/acs/ Need further help? Contact me 

Thanks for your attendance and hope you have not wasted your time.