Introduction to Matlab II EE 2303 Lab. Basic Matlab Review Data file input/output string, char, double, struct  Types of variables load, save  directory/workspace.

Slides:



Advertisements
Similar presentations
Matlab Intro Simple introduction to some basic Matlab syntax. Declaration of a variable [ ] Matrices or vectors Some special (useful) syntax. Control statements.
Advertisements

Introduction to Matlab
Introduction to Matlab Workshop Matthew Johnson, Economics October 17, /13/20151.
M AT L AB Programming: scripts & functions. Scripts It is possible to achieve a lot simply by executing one command at a time on the command line (even.
MATLAB – What is it? Computing environment / programming language Tool for manipulating matrices Many applications, you just need to get some numbers in.
DREAM PLAN IDEA IMPLEMENTATION Introduction to Image Processing Dr. Kourosh Kiani
EGR 106 – Week 2 – Arrays & Scripts Brief review of last week Arrays: – Concept – Construction – Addressing Scripts and the editor Audio arrays Textbook.
Chapter 12 Fourier Transforms of Discrete Signals.
MATLAB and Simulinklecture 31 To days Outline  Functions  Strings  Sparse Arrays  Cell Arrays  Structures  Exercises on this days topics.
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.
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.
BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.
Nonparametric Econometrics1 Intro to Matlab for Data Analysis and Statistical Modeling.
Eng Advanced Marine Vehicles Todays agenda: Lab tomorrow at 2pm (structures lab) ‏ Advanced Marine Party 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.
GUI Input and Output Greg Reese, Ph.D Research Computing Support Group Academic Technology Services Miami University.
1 Lab of COMP 406 Teaching Assistant: Pei-Yuan Zhou Contact: Lab 1: 12 Sep., 2014 Introduction of Matlab (I)
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
Introduction to MATLAB Session 3 Simopekka Vänskä, THL Department of Mathematics and Statistics University of Helsinki 2011.
Chapter 1: Getting Started with MATLAB MATLAB for Scientist and Engineers Using Symbolic Toolbox.
1 Lab 2 of COMP 319 Lab tutor : Shenghua ZHONG Lab 2: Sep. 28, 2011 Data and File in Matlab.
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
MATLAB Harri Saarnisaari, Part of Simulations and Tools for Telecommunication Course.
1 DKT 211 Basic Communication Engineering LAB # 1A : (Lecture 1) Introduction to Matlab  Basic Features  Scientific features  Array Operations  Script.
Chapter 6 Review: User Defined Functions Introduction to MATLAB 7 Engineering 161.
Introduction to Matlab By E. Noura Semary. Contents MATLAB Environment  Command window, Workspace, Path window, Editor window,and Figure window) Basic.
Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz SUNY-New Paltz “Lecture 2”
The Hong Kong Polytechnic University Industrial Centre 1 MatLAB Lesson 9 : Introduction to GUI & Revision Edward Cheung Room W311g.
Cell Arrays Lecture 2/8/ Data Types (Review) 2. General Concept 3. Using Cell-Arrays 1. Syntax/Symbols 2. Dialog Boxes 1.
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.
Instructor: Mian Shahzad Iqbal
ECE 351 M ATLAB I NTRODUCTION ( BY T EACHING A SSISTANTS )
Introduction to Matlab Patrice Koehl Department of Biological Sciences National University of Singapore
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
Introduction to Programming on MATLAB Ecological Modeling Course Sep 11th, 2006.
MATLAB Programming. Why MATLAB is used ? It can use a simple instruction to compute a very complex mathematical function. It provides high resolution.
전자장 1 실험 - Matlab 사용법 - Photonic Systems Laboratory School of EE, Seoul National University Photonic Systems Lab School of EECS, S.N.U.
Basic command Vectors and matrices in Scilab Data types: (real or complex) numbers, vectors, matrices, polynomials, strings, functions, … –Vectors in Scilab:
ECE 1304 Introduction to Electrical and Computer Engineering
Introduction to Matlab
Speech Processing AEGIS RET All-Hands Meeting
Lecture: MATLAB Chapter 1 Introduction
Introduction to MATLAB
Other Kinds of Arrays Chapter 11
Other Kinds of Arrays Chapter 11
Outline Matlab tutorial How to start and exit Matlab Matlab basics.
Seminar 1 for DCSP Using Matlab.
MATLAB DENC 2533 ECADD LAB 9.
Introduction to Matlab
Matlab Workshop 9/22/2018.
StatLab Matlab Workshop
OptiSystem-MATLAB data formats (Version 1.0)
OptiSystem-MATLAB data interchange model and features
MATLAB Tutorial Dr. David W. Graham.
StatLab Workshop: Intro to Matlab for Data Analysis and Statistical Modeling 11/29/2018.
Net 222: Communications and networks fundamentals (Practical Part)
Introduction to MATLAB [Vectors and Matrices] Lab 2
Matlab Basic Dr. Imtiaz Hussain
-seminar 1 for digital signal processing
Introduction to MATLAB
Lecture 4 Image Enhancement in Frequency Domain
ENEE222 Elements of Discrete Signal Analysis Lab 9 1.
Fourier Transforms of Discrete Signals By Dr. Varsha Shah
Presentation transcript:

Introduction to Matlab II EE 2303 Lab

Basic Matlab Review Data file input/output string, char, double, struct  Types of variables load, save  directory/workspace data file movement Navigation/workspace commands clear – clears workspace of all variables close all – close all figure-windows Up-arrow – scroll through recently used command

Basic Matlab Review Fundamentals of matrix computing [ ], Brackets are used to form vectors and matrices { }, Curly braces are used in cell array assignment ( ), Parentheses Enclose arguments of functions Enclose subscripts of vectors and matrices Indicate precedence in arithmetic expressions

Basic Matlab Review Plotting functions plot(), stem()  1-dimensional graphing mesh(), imagesc()  2-dimensional visualization

Creating Arrays cell(M,N)  create M-by-N cell array of empty matrices Individual cells can be any matlab data type Enables matrices with mixed elements e.g.

Creating Arrays zeros(M,N)  create M-by-N zeros matrix ones(M,N)  create M-by-N ones matrix

User Interface Commands More user-friendly Looks slicker Principal UI commands uigetfile() – retrieve files questdlg() – input logical buttons inputdlg() – input values

uigetfile() Retrieves file via browser window Ex: [audio_input, pathname] = uigetfile('*.wav', 'Please select a wav- file');

inputdlg() Parameter input dialog  outputs cell array Ex: lpdlg = inputdlg({'Enter cutoff frequency(in Hz)'},'Low Pass Filter Parameters',1,{'1000'});

questdlg() Asks question – Yes-No-Cancel by default Ex: isdlg = questdlg('Would you like to listen to your input signal?', 'Input sound');

guide GUI Design Environment Alter.fig files Design self- contained gui’s

Debug Mode Used for scripts

Complex Numbers For a complex signal x of size N… real() -- outputs real components imag() – outputs imaginary components abs() – yields magnitude angle() – yields phase of signal By default, i and j are both set to sqrt(-1) Z = x + j*y can also be written: Z = (x,y) essentially a 2d matrix

Discrete Fourier Transform Used to find frequency response of digital signals Discrete signal input  DFT  discrete frequency response Matrix form of DFT:

FFT Example Create an example signal: t = 0:0.001:0.6; x = sin(2*pi*50*t) + … sin(2*pi*120*t); y = x + 2*randn(size(t)); plot(1000*t(1:50),y(1:50)) title('Signal Corrupted with Zero-Mean Random Noise') xlabel('time (milliseconds)')

FFT Example Now find the frequency response using the DFT Y = fft(y,512); Pyy = Y.* conj(Y) / 512; f = 1000*(0:256)/512; plot(f,Pyy(1:257)) title('Frequency content of y') xlabel('frequency (Hz)')

Lab Exercise The goal of this lab is to expand your Matlab repertoire through: Debugging a faulty script Creating a user interface script Creating an audio- Input script

Approximating Reality EE 2303 Lab References: Oppenheim, Schafer. Discrete-Time Signal Processing. 2 nd Edition, 1999, Prentice-Hall. Mathworks Home Page: