MATLAB Jirawat Kanjanapitak (Tae). What is MATLAB A computer program for doing numerical computation including; Arithmetic, Polynomials, Graphics, 2-D.

Slides:



Advertisements
Similar presentations
Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
Advertisements

Introduction to Matlab
1 EMT 101 – Engineering Programming Dr. Farzad Ismail School of Aerospace Engineering Universiti Sains Malaysia Nibong Tebal Pulau Pinang Week 10.
Introduction to Graphing Using MATLAB. Line Graphs  Useful for graphing functions  Useful for displaying data trends over time  Useful for showing.
Matlab Graphics S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Introduction to Matlab: 2D Graphics.
Matrix Manipulation and 2D Plotting
Introduction to MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
MATLAB – What is it? Computing environment / programming language Tool for manipulating matrices Many applications, you just need to get some numbers in.
1.3 ARRAYS, FILES, AND PLOTS + FOURIER SERIES BY MR. Q.
Introduction to Matlab EE 2303 Lab. MATLAB stands for “Matrix Laboratory” APPLICATIONS OF MATLAB:  Mathematical Calculations  Data Analysis & Visualization.
MA/CS375 Fall MA/CS 375 Fall 2002 Lecture 4.
Introduction to Matlab. I use Matlab for: Data analysis Data plotting Image Analysis Also – Simulations (solving odes/pdes/finite element methods) – Minimisations,
EGR106 Week 6 MATLAB FILES Two Dimensional Plots Multiple Plots
MATLAB Basic. Basic Data Elements The basic elements that MATLAB uses are matrices To form a matrix: Enter : A=[ ; ; ;
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Introduction to Matlab 332:202 Discrete Mathematics Spring 2007.
Dr. Jie Zou PHY Welcome to PHY 3320 Computational Methods in Physics and Engineering.
Introduction to MATLAB MECH 300H Spring Starting of MATLAB.
Plotting. Basic Plotting Two vectors of x and y values needed. Vectors need to be of the same length, but not necessarily of the same geometry. For example,
Finding the Inverse of a Matrix
Objective Video Example by Mrs. G Give It a Try Lesson 4.1  Add and subtract matrices  Multiply a matrix by a scalar number  Solve a matrix equation.
1 Chapter 3 Matrix Algebra with MATLAB Basic matrix definitions and operations were covered in Chapter 2. We will now consider how these operations are.
Introduction to Matlab Jianguo Wang CSSCR September 2009.
MATLAB Fundamentals.
1 Introduction to MATLAB MATLAB is all of the following: 1.Computational environment 2.Plotting software 3.Programming language Typical applications: 1.Calculations.
Mathcad Variable Names A string of characters (including numbers and some “special” characters (e.g. #, %, _, and a few more) Cannot start with a number.
259 Lecture 15 Introduction to MATLAB. 2 What is MATLAB?  MATLAB, which stands for “MATrix LABoratory” is a high- performance language for technical.
For loop Khairul anwar.
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
MATLAB INTRO CONTROL LAB1  The Environment  The command prompt Getting Help : e.g help sin, lookfor cos Variables Vectors, Matrices, and Linear Algebra.
What is Matlab? A software environment for interactive numerical computations Examples: –Matrix computations and linear algebra –Solving nonlinear equations.
Martin Ellison University of Warwick and CEPR Bank of England, December 2005 Introduction to MATLAB.
Introduction to MATLAB Session 1 Prepared By: Dina El Kholy Ahmed Dalal Statistics Course – Biomedical Department -year 3.
1 Week 3: Vectors and Matrices (Part III) READING: 2.2 – 2.4 EECS Introduction to Computing for the Physical Sciences.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
How to Use MATLAB A Brief Introduction. 2 What can MATLAB do? Matrix Operations Symbolic Computations Simulations Programming 2D/3D Visualization.
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
Introduction to Engineering MATLAB – 1 Introduction to MATLAB Agenda Introduction Arithmetic Operations MATLAB Windows Command Window Defining Variables.
EECE 360/460 Matlab Tutorial Jan Outline What is Matlab? What is Matlab? Matlab Interface Matlab Interface Basic Syntax Basic Syntax Plotting Graphs.
INTRODUCTION TO MATLAB LAB# 01
Matrices NamingCalculatorApplication. Making & Naming a Matrix Matrix A.
Matlab Screen  Command Window  type commands  Current Directory  View folders and m-files  Workspace  View program variables  Double click on a.
MATLAB Jirawat Kanjanapitak (Tae). What is MATLAB A computer program for doing numerical computation including; Arithmetic, Polynomials, Graphics, 2-D.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
MATLAB – PT1 The purpose of this workshop is to get you started and to have fun with MATLAB! Let’s talk a little and decide on what we will be covering.
1. Overview 2. plot in 2D 3. Plot in 3D 4. Other possible charts 5. Engineers: label your plots! 6. Plots & Polynomial Plotting 11.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
1-d Arrays & Plotting.
Algebra Matrix Operations. Definition Matrix-A rectangular arrangement of numbers in rows and columns Dimensions- number of rows then columns Entries-
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
Introduction to Matlab Engr. Mian Shahzad Iqbal LAB NO.2
Precalculus Section 14.1 Add and subtract matrices Often a set of data is arranged in a table form A matrix is a rectangular.
Array and Matrix Operations EE 201 Fall  Achieve Comprehension LOL of Array and Matrix Operations. Class Learning Objectives 2.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
How to use MATLAB (using M-files) Double click this icon To start Matlab 6.5.
ECE 1304 Introduction to Electrical and Computer Engineering
Introduction to MATLAB
13.4 Product of Two Matrices
Signals in Matlab Matlab as a name stands for Matrix Laboratory.
Matrix Equations Step 1: Write the system as a matrix equation. A three-equation system is shown below. First matrix are the coefficients of all the.
Matrices and Arrays.
MATLAB DENC 2533 ECADD LAB 9.
EEE 244 Numerical Methods In Electrical Engineering
MATLAB How to use (using M-files) Double click this icon
MATLAB How to use (using M-files) Double click this icon
MATLAB How to use (using M-files)
Demo of Basic Matlab Features
3.5 Perform Basic Matrix Operations
3.6 Multiply Matrices.
Chapter 4 Matrices & Determinants
Presentation transcript:

MATLAB Jirawat Kanjanapitak (Tae)

What is MATLAB A computer program for doing numerical computation including; Arithmetic, Polynomials, Graphics, 2-D Plots, Matrices, Systems of Equations etc.

Getting Started

Open Program Click “MATLAB R2006a” on Desktop OR Go to “Start” All Program > MATLAB > MATLAB R2006a

MATLAB Desktop Default layout Arranging the Desktop including resizing, moving, and closing tools.

Taken from MATLAB Help

MATLAB for Problem Solving

Arithmetic Calculator >> 1+1 ans = 2 >> (7*5)+2 ans = 37 >> [(8+2^2)/(1*3)] ans = 4 Type in any basic arithmetic as shown  Click “Enter”

Basic Operations OperationMATLAB x + y x - y x yx*y x / y xyxy x^y exex exp(x) | x |abs(x) πpi sqrt(x)

Vectors To enter a vector >> v = [1 2 3] v = To transpose a column vector to a row vector, use an apostrophe “‘“ >>v = [1 2 3] ’ v = To increment using colon >> v = [1:5] v = To increment other than1 >>v = [5:0.5:7] v = To view individual entries in this vector v(2) Ans = 5.5

Vector Examples >> v = [1:5]; >> u = [0:-1:4]; u+v Ans: v^2 Ans: Note: Error message will appear from adding two vectors whose dimensions are different.

Matrices To enter a matrix Use command >> a = [ 1 2; 3 4 ]

Matrix Examples >> a = [ 1 2; 3 4 ]; >> b = [ 0 1; 2 3 ]; >> a+b ans = >>a*b ans = T = a+b; >> inv(t) ans = >> inv(t)/t ans =

Plotting Use “plot” command Format: plot(x,y, ‘m’) The third input is a characteristic of the graph. yyellow mmagenta ccyan rred ggreen bblue kblack *star.dotted --dashed xx-mark

Plotting Examples x = 0:0.1:100; y = 2*x; plot (x,y,'--')

Plotting Examples 2 x = 0:0.1:5; y = sin (x); plot (x,y,'x')

Plotting Examples 3 x = linspace(0,2*pi,50); y = sin (x); z = cos (x); plot (x,y, x,z)

Sub-Plotting Use “subplot” command to put more than one plot in the same figure subplot (m,n,p) where; m = number of rows n = number of column p = plot number

Sub-Plotting Example x = linspace(0,2*pi,50); y = sin (x); z = cos (x); subplot (1,2,1) plot (x,y) subplot (1,2,2) plot (x,z)

Adding Text Below are the text adding related commands title (‘title name’) xlabel (‘label of the x-axis’) ylabel (‘label of the y-axis’) gtext (‘put text in the middle of plot’)

Adding Text Example x = 0:0.1:100; y = 2*x; plot (x,y,'--') title ('title name') xlabel ('label of the x-axis') ylabel ('label of the y-axis') gtext ('put text in the middle of plot')

Polynomials Vector is used to represented polynomial in MATLAB. For example; t 3 +4t 2 -3t+1 x = [ ] or x 5 +3x 2 -6 x = [ ]

Polynomial Examples To multiply two polynomial x = [1 2 3]; y = [ ]; z = conv(x,y) z = To devide two polynomial [xx, w] = deconv(z,y) xx = w = 0 0 0

Getting HELP! Use “help” command help commandname