The MATLAB system The MATLAB system consists of five main parts:

Similar documents
Introduction to MATLAB

Lecture 1: What is MATLAB?

Using Matlab in the Chemical Engineering Curriculum at the University of Tennessee. A Workshop presented by David Keffer August 17, 2001

2.0 MATLAB Fundamentals

MATLAB. Miran H. S. Mohammed. Lecture 1

Fundamentals of MATLAB Usage

Introduction to MATLAB for CSE390

System Design S.CS301

BRUNO WELFERT Arizona State University AND. R. Kent Nagle. University of South Florida. Edward B. Saff. Vanderbilt University. A.

INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX

Lab of COMP 406. MATLAB: Quick Start. Lab tutor : Gene Yu Zhao Mailbox: or Lab 1: 11th Sep, 2013

Experiment 8 SIMULINK

MATLAB is a multi-paradigm numerical computing environment fourth-generation programming language. A proprietary programming language developed by

Lab. Manual. Practical Special Topics (Matlab Programming) (EngE416) Prepared By Dr. Emad Saeid

Introduction to MATLAB

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

Computer Exercises for Econometrics

How to Use MATLAB. What is MATLAB. Getting Started. Online Help. General Purpose Commands

Introduction to Matlab

Experiment 6 SIMULINK

ME305: Introduction to System Dynamics

MATLAB Primer John F. Patzer II

3 An Introductory Demonstration Execute the following command to view a quick introduction to Matlab. >> intro (Use your mouse to position windows on

ENGR 253 LAB #1 - MATLAB Introduction

Computational Photonics, Summer Term 2014, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch

Introduction to MATLAB

Chapter 1 Introduction to MATLAB

Matlab Tutorial. The value assigned to a variable can be checked by simply typing in the variable name:

MATLAB Tutorial EE351M DSP. Created: Thursday Jan 25, 2007 Rayyan Jaber. Modified by: Kitaek Bae. Outline

Module 4. Computer-Aided Design (CAD) systems

MATLAB = MATrix LABoratory. Interactive system. Basic data element is an array that does not require dimensioning.

MATLAB The first steps. Edited by Péter Vass

Grace days can not be used for this assignment

SIGNALS AND LINEAR SYSTEMS LABORATORY EELE

[ MATLAB ] [ Resources ] PART TWO: SIMULINK

An Introduction to MATLAB See Chapter 1 of Gilat

Introduction to Scientific Computing with Matlab

Matlab Lecture 1 - Introduction to MATLAB. Five Parts of Matlab. Entering Matrices (2) - Method 1:Direct entry. Entering Matrices (1) - Magic Square

MatLab Just a beginning

Introduction to Matlab Simulink. Control Systems

Matlab notes Matlab is a matrix-based, high-performance language for technical computing It integrates computation, visualisation and programming usin

University of Alberta

STAT/MATH 395 A - PROBABILITY II UW Winter Quarter Matlab Tutorial

YOGYAKARTA STATE UNIVERSITY MATHEMATICS AND NATURAL SCIENCES FACULTY MATHEMATICS EDUCATION STUDY PROGRAM

Session 3 Introduction to SIMULINK

MATLAB MATLAB mat lab funtool

SIMULINK A Tutorial by Tom Nguyen

Introduction to Engineering gii

SIGNALS AND SYSTEMS I Computer Assignment 2

Eng Marine Production Management. Introduction to Matlab

Dr Richard Greenaway

MATLAB BASICS. M Files. Objectives

Introduction to Scientific Computing with Matlab

PRACTICAL file. Department: Computer Science and Engineering. Simulation and Modeling Lab. Subject Code: BTCS 607. Semester:

Using MATLAB, SIMULINK and Control System Toolbox

Introduction to MATLAB

MATLAB 7. The Language of Technical Computing KEY FEATURES

ACSE Manuals Archive List of Contents

Polymath 6. Overview

Collection of Laboratories Course on Aerospace Engineering

Starting Matlab. MATLAB Laboratory 09/09/10 Lecture. Command Window. Drives/Directories. Go to.

MATLAB NOTES. Matlab designed for numerical computing. Strongly oriented towards use of arrays, one and two dimensional.

Colorado State University Department of Mechanical Engineering. MECH Laboratory Exercise #1 Introduction to MATLAB

Introduction to MATLAB

! The MATLAB language

MATLAB Lecture 1. Introduction to MATLAB

Basic MATLAB. Getting MATLAB (for MIT students) Creating matrices and vectors. Some operation of matrices/vectors.

MATH (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab

AMATH 352: MATLAB Tutorial written by Peter Blossey Department of Applied Mathematics University of Washington Seattle, WA

MATLAB Premier. Middle East Technical University Department of Mechanical Engineering ME 304 1/50

ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu

ENGR 1181 MATLAB 02: Array Creation

STEPHEN WOLFRAM MATHEMATICADO. Fourth Edition WOLFRAM MEDIA CAMBRIDGE UNIVERSITY PRESS

A/D Converter. Sampling. Figure 1.1: Block Diagram of a DSP System

Getting Started with MATLAB

Math Scientific Computing - Matlab Intro and Exercises: Spring 2003

An Introduction to MATLAB. Lab tutor : Dennis Yang LIU Lab 1: Sept. 11, 2014

Matlab Tutorial, CDS

An Introduction to Matlab for DSP

Introduction to Matlab

DSP First. Laboratory Exercise #1. Introduction to MATLAB

AMS 27L LAB #1 Winter 2009

Experiment 3. Getting Start with Simulink

Inlichtingenblad, matlab- en simulink handleiding en practicumopgaven IWS

Eric W. Hansen. The basic data type is a matrix This is the basic paradigm for computation with MATLAB, and the key to its power. Here s an example:

INTRODUCTION TO MATLAB

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

Scientific Computing: Lecture 1

EE3TP4: Signals and Systems Lab 1: Introduction to Matlab Tim Davidson Ext Objective. Report. Introduction to Matlab

EE 216 Experiment 1. MATLAB Structure and Use

MATLAB Introduction. Ron Ilizarov Application Engineer

2007 Maplesoft, a division of Waterloo Maple Inc.

Note 10 Introduction to MATLAB & SIMULINK

(Creating Arrays & Matrices) Applied Linear Algebra in Geoscience Using MATLAB

Introduction to MatLab. Introduction to MatLab K. Craig 1

Matlab Tutorial. Get familiar with MATLAB by using tutorials and demos found in MATLAB. You can click Start MATLAB Demos to start the help screen.

Introduction to Matlab

Process Automation CHEM-E7140

A Guide to Using Some Basic MATLAB Functions

Learning from Data Introduction to Matlab

Transcription:

Introduction to MATLAB What is MATLAB? The name MATLAB stands for matrix laboratory. 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. Typical uses include: Math and computation Algorithm development Modeling, simulation and prototyping Data analysis, exploration and visualization Scientific and engineering graphics Application development, including graphical user interface building MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. This allows you to solve many technical computing problems, especially those with matrix and vector formulations. Toolboxes MATLAB features a family of application specific solutions called toolboxes. Toolboxes are comprehensive collections of MATLAB functions (M-files) that extend the MATLAB environment to solve particular class of problems. The following is the list of toolboxes currently available in MATLAB: Communications tool box Signal processing tool box Image processing tool box Wavelet tool box Neural network tool box Data acquisition tool box Fuzzy logic tool box Control systems tool box Optimization tool box Spline tool box Statistics tool box Symbolic math tool box The MATLAB system The MATLAB system consists of five main parts: The MATLAB language. This is a high level matrix/array language with control flow statements, functions, data structures, input-output, and object oriented programming features. The MATLAB working environment. This is set of tools and facilities that you work with as a Matlab user or programmer

Handle Graphics. It includes high level commands for two-dimensional and three dimensional data visualization, image processing, animation, and presentation graphics The MATLAB mathematical function library. This is a vast collection of computation algorithms ranging from elementary functions like sum, sine cosine to more sophisticated functions like matrix inverse, fast fourier transforms. The MATLAB Application Program Interface (API). This is a library that allows you to write C and fortran programs that interact with Matlab What is Simulink? Simulink, a companion program to MATLAB, is an interactive system for simulating non-linear dynamic systems. It is a graphical mouse driven program that allows you to model a system by drawing a block diagram on the screen and manipulating it dynamically. It can work with linear, nonlinear, continuous time, discrete time, multi rate and hybrid systems. Block sets are add-ons to simulink that provide additional libraries of blocks for specialized applications like communications, signal processing, and power systems. There are both UNIX and PC (WINDOWS) versions of MATLAB, also available in PC version is the STUDENT version of MATLAB. MATLAB can be accessed in the following ways: In the open access lab you can directly run MATLAB by going to Start->Programs->Applications->Matlab6.0 (PC version) On a remote terminal follow this procedure Start->Run->telnet sunblast->login->on the prompt type MATLAB (UNIX version) MATLAB can be interactively used in two ways: Directly from the command window -Command window is the window which pops up when you open MATLAB. Programmed by the creation of M-files -M-files are the text files made up of MATLAB commands. MATLAB related books and web-sites An up to date list of hundreds of MATLAB related books is available at www.mathworks.com/books. Many resources for various branches of mathematics and science are at the education specific web site www.mathworks.com/education. For getting started and using MATLAB go to http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.shtml Getting Started Invoke MATLAB like any WINDOWS program. A text oriented command window will pop up, initially looking like:

To get started, type one of these commands: helpwin, helpdesk, or demo. For information on all of the MathWorks products, type tour. The sign is the MATLAB prompt. You may use one of the suggested commands, or any other commands and proceed. DEMO 1 % This demo introduces to one of the basic matrix computational tool that is available in MATLAB. % To enter a matrix, spaces are put between elements and semicolons are used to separate the rows. % Brackets are placed around the data. For example to enter a 3-by-3 matrix A, type: A = [1 2 3; 4 5 6; 7 8 0] % which results in : A = 1 2 3 4 5 6 7 8 0 % We can run through some basic operations. For example our matrix A can be transposed with: B = A % which results in : B = 1 4 7 2 5 8 3 6 0 DEMO 2 % The following code will create 41 points of a discrete-time sinusoid x(n) = sin(n); index = 0:40; sine = sin(index); stem(index,sine); %vector of time indices % plot the sine function Note that index(1) and sine (1) refer to n=0 in MATLAB. Try the changes to code with sine = sin(index/4) and sine = sin(index/2+1) and observe their effects. The demonstration actually tells you most of what you need to know MATLAB. Much of the rest can be learned from the help command. At the prompt type help to see a screen like: help HELP topics: matlab\general matlab\ops matlab\lang matlab\elmat matlab\elfun matlab\specfun matlab\matfun - General purpose commands. - Operators and special characters. - Programming language constructs. - Elementary matrices and matrix manipulation. - Elementary math functions. - Specialized math functions. - Matrix functions - numerical linear algebra.

matlab\datafun - Data analysis and Fourier transforms. matlab\polyfun - Interpolation and polynomials. matlab\funfun - Function functions and ODE solvers. matlab\sparfun - Sparse matrices. matlab\graph2d - Two dimensional graphs. matlab\graph3d - Three dimensional graphs. matlab\specgraph - Specialized graphs. matlab\graphics - Handle Graphics. matlab\uitools - Graphical user interface tools. matlab\strfun - Character strings. matlab\iofun - File input/output. matlab\timefun - Time and dates. matlab\datatypes - Data types and structures. matlab\dde - Dynamic data exchange (DDE). matlab\demos - Examples and demonstrations. comm\comm - Communications Toolbox comm\commsfun - Communications Toolbox SIMULINK S-functions. comm\commsim - Communications Toolbox SIMULINK files. wavelet\wavelet - Wavelet Toolbox. wavelet\wavedemo - Wavelet Toolbox Demos. fuzzy\fuzzy - Fuzzy Logic Toolbox. fuzzy\fuzdemos - Fuzzy Logic Toolbox Demos. fdident\fdident - Frequency Domain Identification Toolbox. fdident\fddemos - Demonstrations for the FDIDENT Toolbox toolbox\stats - Statistics Toolbox. images\images - Image Processing Toolbox. images\imdemos - Image Processing Toolbox --- demos and sample images nnet\nnet - Neural Network Toolbox. nnet\nndemos - Neural Network Demonstrations and Applications. toolbox\signal - Signal Processing Toolbox. toolbox\splines - Splines Toolbox. toolbox\optim - Optimization Toolbox. toolbox\ident - System Identification Toolbox. toolbox\control - Control System Toolbox. control\obsolete - (No table of contents file) stateflow\stateflow - Stateflow stateflow\sfdemos - (No table of contents file) simulink\simulink - Simulink simulink\blocks - Simulink block library. simulink\simdemos - Simulink demonstrations and samples. simulink\dee - Differential Equation Editor toolbox\tour - An interface to Matlab demos, installed Toolboxes demos, and information toolbox\local - Preferences. For more help on directory/topic, type "help topic". This screen is really listing of directories in the MATLAB path, which is specified in pathdef.m in the matlab\toolbox\local directory. You can modify this path to create directories (like matlab\sankar in the above) to contain your own programs (M-files) which you can then call just like any other MATLAB function. To obtain a listing and brief description of the commands in any of the directories mentioned, use help, followed by the directory name. Also use help, followed by any function name to get a description on it. For example

Example 1 help sin SIN Sine. SIN(X) is the sine of the elements of X. Example 2 help filter FILTER One-dimensional digital filter. Y = FILTER(B,A,X) filters the data in vector X with the filter described by vectors A and B to create the filtered data Y. The filter is a "Direct Form II Transposed" implementation of the standard difference equation: a(1)*y(n) = b(1)*x(n) + b(2)*x(n-1) +... + b(nb+1)*x(n-nb) - a(2)*y(n-1) -... - a(na+1)*y(n-na) If a(1) is not equal to 1, FILTER normalizes the filter coefficients by a(1). When X is a matrix, FILTER operates on the columns of X. When X is an N-D array, FILTER operates along the first non-singleton dimension. [Y,Zf] = FILTER(B,A,X,Zi) gives access to initial and final conditions, Zi and Zf, of the delays. Zi is a vector of length MAX(LENGTH(A),LENGTH(B))-1 or an array of such vectors, one for each column of X. FILTER(B,A,X,[],DIM) or FILTER(B,A,X,Zi,DIM) operates along the dimension DIM. See also FILTER2, FILTFILT (in the Signal Processing Toolbox). The same kind of information can be accessed graphically by using helpwin command. A more detailed documentation is available in HTML format using helpdesk if you have a web browser and have installed all of the help files. To exit MATLAB, type exit or quit, or use the file menu, as with most Windows applications.