MatlABBA. The Colon Operator (1) This is one MatLab’s most important operators 1:10 means the vector –1 2 3 4 5 6 7 8 9 10 100:-7:50 –100 93 86 79 72.

Slides:



Advertisements
Similar presentations
Introduction to Matlab
Advertisements

Introduction to MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
Maths for Computer Graphics
EGR 106 – Week 2 – Arrays Definition, size, and terminology Construction methods Addressing and sub-arrays Some useful functions for arrays Character arrays.
EGR 106 – Week 2 – Arrays Definition, size, and terminology Construction methods Addressing and sub-arrays Some useful functions for arrays Character arrays.
Introduction to MATLAB 7 for Engineers
The ‘PLOT’ Command (1) >> X = linspace(0, 2*pi, 30); >> Y = sin(X); >> plot(X,Y) >> Z = cos(X); >> plot(X,Y,X,Z);
MATLAB Basic. Basic Data Elements The basic elements that MATLAB uses are matrices To form a matrix: Enter : A=[ ; ; ;
Matlab Intro. Outline Matlab introduction Matlab elements Types Variables Matrices.
Dr. Jie Zou PHY Welcome to PHY 3320 Computational Methods in Physics and Engineering.
Intro to Matlab 1.Vectors, matrices, and arithmetic 2.Plotting 3.Flow Constructs 4.Other Useful Things Can be found at:
Plotting - Advanced. FPLOT Plots a function f(x) written as a string within quotation marks. The free variable needs to be designated with x. The lower.
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 intro The Environment
1 MATLAB 基礎. 2 MATLAB  Workspace: environment (address space) where all variables reside  After carrying out a calculation, MATLAB assigns the result.
MATLAB Basics With a brief review of linear algebra by Lanyi Xu modified by D.G.E. Robertson.
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.
1 M ATLAB Short Course. History of Calculator 2 3 Introduction to Matlab Matlab is short for Matrix Laboratory Matlab is also a programming language.
Introduction to MATLAB January 18, 2008 Steve Gu Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB,
Introduction to MATLAB
Matlab Chapter 2: Array and Matrix Operations. What is a vector? In Matlab, it is a single row (horizontal) or column (vertical) of numbers or characters.
MEGN 536 – Computational Biomechanics MATLAB: Getting Started Prof. Anthony J. Petrella Computational Biomechanics Group.
Matlab for Engineers Built-in Matlab Functions Chapter 3.
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
26 - 3/20/2000AME 150L1 M ATLAB ® /20/2000AME 150L2 M ATLAB ® vs. Fortran Fortran Positives –First Compiler –Legacy Codes –Efficient Numerically.
Sundermeyer MAR 550 Spring Laboratory in Oceanography: Data and Methods MAR550, Spring 2013 Miles A. Sundermeyer Introduction to Matlab ® Programming.
ME6104: CAD. Module 4. ME6104: CAD. Module 4. Systems Realization Laboratory Module 4 Matlab ME 6104 – Fundamentals of Computer-Aided Design.
MA/CS 375 Fall 2002 Lecture 3. Example 2 A is a matrix with 3 rows and 2 columns.
Matlab Screen  Command Window  type commands  Current Directory  View folders and m-files  Workspace  View program variables  Double click on a.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Chapter 2 Creating Arrays Legend: MATLAB command or syntax : Blue MATLAB command OUTPUT : LIGHT BLUE.
Philosophiae Naturalis Principia Matlab ematica Damian Gordon.
Polynomials UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
Matlab Tutorial Iman Moazzen First Session – September 11, 2013.
CS100A, Fall 1998, Lecture 191 CS100A, Fall 1998 Lecture 19, Thursday Nov 05 Matlab Concepts: Matlab arrays Matlab subscripting Matlab plotting.
CS100A, Fall 1998, Lecture 201 CS100A, Fall 1998 Lecture 20, Tuesday Nov 10 More Matlab Concepts: plotting (cont.) 2-D arrays Control structures: while,
EEE 242 Computer Tools for Electrical Engineering Lecture I Mustafa KARABULUT.
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.
LAB 2 Vectors and Matrices Dr.Abdel Fattah FARES.
MATLAB ……………….matrix laboratory. Bhushan D Patil PhD Research Scholar Department of Electrical Engineering Indian Institute of Technology, Bombay Powai,
Tutorial on Matlab Basics
Prof. Mark Glauser Created by: David Marr
ECE 1304 Introduction to Electrical and Computer Engineering
Signals in Matlab Matlab as a name stands for Matrix Laboratory.
Built-in MATLAB Functions Chapter 3
EGR 115 Introduction to Computing for Engineers
Statistical Computing in MATLAB
Seminar 1 for DCSP Using Matlab.
MATLAB DENC 2533 ECADD LAB 9.
Matlab Workshop 9/22/2018.
Introduction To MATLAB
Math.375 Fall 2005 I - Numbers and Formats
StatLab Matlab Workshop
MATH 493 Introduction to MATLAB
Hello worLd, variables, arrays, plots, for loops, Simulation
Introduction to MATLAB Lecture 02
Vectors and Matrices I.
Communication and Coding Theory Lab(CS491)
Arrays and Matrices in MATLAB
Vectors, matrices, and arithmetic
Matlab Intro.
Announcements P3 due today
-seminar 1 for digital signal processing
Laboratory in Oceanography: Data and Methods
Matlab Intro.
Announcements.
Presentation transcript:

matlABBA

The Colon Operator (1) This is one MatLab’s most important operators 1:10 means the vector – :-7:50 – :pi/4:pi –

The Colon Operator (2) The first K elements in the jth column is –A(1:K, j) Sum(A(1:4, 4)) is the sum of the 4th column or Sum(A(:, 4)) means the same

Deleting Rows and Columns (1) Create a temporary matrix X X=A; X(:, 2) = [] Deleting a single element won’t result in a matrix, so the following will return an error X(1,2) = []

Deleting Rows and Columns (2) However, using a single subscript, you can delete –a single element –sequence of elements So X(2:2:10) = [] gives x =

The ‘FIND’ Command (1) >> x = -3:3 x = K = find(abs(x) > 1) K =

The ‘FIND’ Command (2) A = [ ; ; 7 8 9] [i, j] = find (A > 5) i = j = 1 2 3

Special Variables ans pi eps flops inf NaN i,j why - default name for results - pi - “help eps” - count floating point ops - Infinity, e.g. 1/0 - Not a number, e.g. 0/0 - root minus one - why not ?

LOGO Command

The ‘PLOT’ Command (1) >> X = linspace(0, 2*pi, 30); >> Y = sin(X); >> plot(X,Y) >> Z = cos(X); >> plot(X,Y,X,Z);

The ‘PLOT’ Command (2) >> W = [Y ; Z] >> plot (X,W) Rotate by 90 degrees >> plot(W,X)