Introduction to Matlab:

Slides:



Advertisements
Similar presentations
Introduction to Matlab
Advertisements

MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
Introduction to M ATLAB Programming Ian Brooks Institute for Climate & Atmospheric Science School of Earth & Environment
Introduction to Matlab
MATLAB – What is it? Computing environment / programming language Tool for manipulating matrices Many applications, you just need to get some numbers in.
Programming Environment S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Introduction to Matlab: Cells and Structures.
Maths for Computer Graphics
Matlab Intro. Outline Matlab introduction Matlab elements Types Variables Matrices.
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.
1 MATLAB 基礎. 2 MATLAB  Workspace: environment (address space) where all variables reside  After carrying out a calculation, MATLAB assigns the result.
Lecture 13: M/O/F/ for Engineering Applications - Part 1 BJ Furman 26NOV2012.
MATLAB Lecture One Monday 4 July Matlab Melvyn Sim Department of Decision Sciences NUS Business School
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation tools. Others include Maple Mathematica MathCad.
Introduction to Engineering MATLAB – 2 Introduction to MATLAB - 2 Agenda Defining Variables MATLAB Windows.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
MATLAB Programming COMM2M Harry R. Erwin, PhD University of Sunderland.
Matlab Basic. MATLAB Product Family 2 3 Entering & Quitting MATLAB To enter MATLAB double click on the MATLAB icon. To Leave MATLAB Simply type quit.
INTRODUCTION TO MATLAB DAVID COOPER SUMMER Course Layout SundayMondayTuesdayWednesdayThursdayFridaySaturday 67 Intro 89 Scripts 1011 Work
The Hong Kong Polytechnic University Industrial Centre MatLAB Lesson 1 : Overview & Environment Edward Cheung Room W311g.
INTRODUCTION TO MATLAB Dr. Hugh Blanton ENTC 4347.
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
Introduction to Engineering MATLAB – 4 Arrays Agenda Creating arrays of numbers  Vectors: 1-D Arrays  Arrays: 2-D Arrays Array Addressing Strings & String.
Introduction to MATLAB 1.Basic functions 2.Vectors, matrices, and arithmetic 3.Flow Constructs (Loops, If, etc) 4.Create M-files 5.Plotting.
BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.
Introduction to Matlab Patrice Koehl Department of Biological Sciences National University of Singapore
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
Lecture 12: M/O/F/ for Engineering Applications B Burlingame 27 April 2016.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
전자장 1 실험 - Matlab 사용법 - Photonic Systems Laboratory School of EE, Seoul National University Photonic Systems Lab School of EECS, S.N.U.
ECE 1304 Introduction to Electrical and Computer Engineering
MATLAB Exercises Assoc. Prof. Dr. Pelin GÜNDEŞ
12-1 Organizing Data Using Matrices
ECE 1304 Introduction to Electrical and Computer Engineering
Release Numbers MATLAB is updated regularly
Introduction to Matlab
Introduction to Matrices
EGR 115 Introduction to Computing for Engineers
Matrix Operations.
Other Kinds of Arrays Chapter 11
2) Platform independent 3) Predefined functions
Matrix Operations SpringSemester 2017.
INTRODUCTION TO BASIC MATLAB
MATLAB DENC 2533 ECADD LAB 9.
Introduction To MATLAB
Introduction To Matlab Class 1
WarmUp 2-3 on your calculator or on paper..
MATLAB (Lecture 2) BY:MAHA ALMOUSA.
MATH 493 Introduction to MATLAB
Use of Mathematics using Technology (Maltlab)
2.2 Introduction to Matrices
Communication and Coding Theory Lab(CS491)
Introduction to MATLAB
Introduction to Matlab
Matlab Intro.
INTRODUCTION TO MATLAB
Simulation And Modelling
Matlab Basic Dr. Imtiaz Hussain
Using Script Files and Managing Data
MATLAB Introduction MATLAB can be thought of as a powerful graphing calculator but with a lot more buttons! It is also a programming language, commands.
CS 111 Introduction to Computing in Engineering and Science
Determinants 2 x 2 and 3 x 3 Matrices.
Introduction to Matlab: Element by Element Operations
Determinants 2 x 2 and 3 x 3 Matrices.
Matrix Operations SpringSemester 2017.
MATLAB (Lecture 2) BY:MAHA ALMOUSA.
Matlab Intro.
Computer Simulation Lab
Presentation transcript:

Introduction to Matlab: Matlab Basics Matlab Environment S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn

Matlab Environment Topics Invoking Matlab Punctuation Entering Real Data Entering Matrices Entering Complex Data Entering Character Strings Getting Help Examining Workspace Variables Clearing Workspace Variables

Invoking Matlab » To invoke Matlab, Click on the Matlab icon The program will give the following prompt: » Now we can enter commands to be executed » command1, command2, command3;

Matlab Punctuation , (comma) Separates commands on a line Also used to separate elements in a matrix ; Separates commands on a line and inhibits the display of intermediate results Also used to terminate a row in a matrix % Denotes comment after this sign … Denotes a continuation character ! A system command follows this character Note: Matlab is case sensitive

Entering Real Data Real Numbers Complex Numbers Character Strings Examples of User Defined Variables » a = 2; % A scalar, 1 by 1 matrix » b = [ 1 2 3]; % A row vector » c = [5 6 7]’; % A column vector

Entering Matrices Two ways to enter Matrices: Method 1: Use ; to separate rows » B=[1 2 3;4 5 6;7 8 9]; Method 2: Type Enter to go to following line » B = [ 1 2 3 4 5 6 7 8 9 ];

Creating Complex Data The square root of negative one is represented by the Matlab Constants i and j » x = 2 + 2*j; % A complex number » x = 2 + 2j; % Another way

Entering a Complex Matrix Enter the Real part of 3 x 3 Matrix » cr=[ 2, 5, -2;0, 5, 10;11, 2, 1]; Enter Imaginary part » ci=[-2, 0, 0;0,-7,-12; 0, 5, 1]; Add both components of the Matrix c » c=cr + j*ci;

Entering Character Strings Character strings can be stored as variables » x='This is an example.' Use the display command to view the variable » display(x) This is an example

Help Lookfor Helpdesk Getting Help There are three ways of getting help in Matlab Help Lookfor Helpdesk

Getting Help: Help The help command displays information about the command: » help sum SUM Sum of elements. For vectors, SUM(X) is the sum of the elements of X. For matrices, SUM(X) is a row vector with the sum over each column. For N-D arrays, SUM(X) operates along the first non-singleton dimension. .

Getting Help: Lookfor The lookfor command searches all of the functions based on a keyword and lists all related commands » lookfor spectrum FFTSHIFT Shift DC component to center of spectrum. PMEM Power Spectrum estimate via MEM (Maximum PMTM PMUSIC Power Spectrum estimate via MUSIC eigenvector SPECPLOT Plot the output of the SPECTRUM function. SPECTRUM Power spectrum estimate of one or two .

Getting Help: Helpdesk The helpdesk command loads the main Matlab desk page into the web browser

Examining the Matlab Workspace The data and variables the user creates and/or imports in the command window is found in the so called Matlab workspace To see what variable names the user has entered, use the who command: » who Your variables are: B a b c

Examining the Matlab Workspace in Detail For more detailed information, use whos command » whos Name Size Bytes Class B 3x3 72 double array a 1x1 8 double array b 1x3 24 double array c 3x1 24 double array Grand total is 16 elements using 128 bytes Note: 8 bytes per element is used in a double

Clearing Workspace Variables Use the clear command to remove variables clear a b; % Removes a & b clear; % Removes all variables clear functions; % Removes all compiled % functions