A Brief Introduction to MATLAB Evans Library Research Support Workshops

Size: px
Start display at page:

Download "A Brief Introduction to MATLAB Evans Library Research Support Workshops"

Transcription

1 A Brief Introduction to MATLAB Evans Library Research Support Workshops G.C. Anagnostopoulos 1 1 ICE Laboratory, Florida Institute of Technology November 4 th, 2015

2 The Roadmap 1 Introduction 2 Programming in MATLAB 3 Graphing in MATLAB 4 MATLAB Toolboxes 5 Short MATLAB Demonstration 6 Alternatives to MATLAB 7 References 8 Epilogue Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

3 Introduction Introduction Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

4 Introduction What is MATLAB MAtrix LABoratory MATLAB, not MATHLAB Platform/environment combining computational & graphing capabilities Uses its own interpreted, scripting language Published by MathWorks [MathWorks(2015a)] Over a million of engineering and science users Commercial product; costs $$$ Good news #1: Florida Tech has many licenses Good news #2: affordable student version Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

5 Introduction Origins Cleve Moler author of LINPACK and EISPACK invented MATLAB in the 70 s at University of New Mexico Co-founded MathWorks in 1984 with John Little and Steve Bangert. Figure: Cleve Moler Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

6 Introduction Advantages Excellent rapid prototyping tool Allows interfacing with other languages Ability to build standalone applications Extended via numerous toolboxes Supports GPU and cluster computing Extensive online support via Mathworks website MATLAB Central File Exchange [MathWorks(2015b)]: a user community Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

7 Programming in MATLAB Programming in MATLAB Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

8 Programming in MATLAB MATLAB GUI Figure: MATLAB GUI screenshot Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

9 Programming in MATLAB MATLAB Editor Figure: MATLAB Editor screenshot Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

10 Programming in MATLAB Data Types MATLAB supports a variety of data types. Numeric Integers, Floating Points, Complex Numbers, Infinity, NaN, etc. Strings Categorical Function handles etc. Most of them can be thought of as matrices (even scalars!) Arrays Cell Arrays Matrices Structures & Classes etc. Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

11 Programming in MATLAB Main Programming Features Control Flow if, elseif, else, switch, case while, for try, catch Operators Arithmetic: +,,, /,, etc. Relational: <, >, <=, >=, ==, = Logical: &,,, xor, etc. Set Bit-wise Functions I/O operations (Data Import/Export) GUI construction Debugging & Profiling Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

12 MATLAB Functions Programming in MATLAB Functions are stored in their own *.m files Can have multiple input & output arguments Example function: 1 % MYFACTORIAL 2 % Returns the factorial of a positive integer. 3 % Stored in myfactorial.m 4 function value = myfactorial(n) 5 6 if n == 0 7 value = 1; 8 else 9 value = n * myfactorial(n-1); 10 end return Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

13 Programming in MATLAB GUI Example Figure: GUI example Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

14 Programming in MATLAB Object-Oriented Programming Supported to some extend e.g., Inheritance, but not polymorphism Has its own idiosyncrasies Ever-evolving Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

15 Graphing in MATLAB Graphing in MATLAB Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

16 Graphing in MATLAB Visualization in MATLAB 2D and 3D plots Images Formatting & Annotation Exporting graphics Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

17 Examples of Plots I Graphing in MATLAB Figure: Combined Line & Stem Plot Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

18 Examples of Plots II Graphing in MATLAB Figure: Overlay 2D Bar Graphs Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

19 Examples of Plots III Graphing in MATLAB Figure: Combine Contour Plot and Quiver Plot Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

20 Examples of Plots IV Graphing in MATLAB Figure: Color 3D Bar Graph Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

21 Examples of Plots V Graphing in MATLAB Figure: Polar Plot Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

22 Examples of Plots VI Graphing in MATLAB Figure: Stream Line Plot of Vector Data Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

23 Examples of Plots VII Graphing in MATLAB Figure: Surface Plot Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

24 Examples of Plots VIII Graphing in MATLAB Figure: Image Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

25 Examples of Plots IX Graphing in MATLAB Figure: 3-D Contour Slice Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

26 Examples of Plots X Graphing in MATLAB Figure: Isocaps Plot Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

27 Examples of Plots XI Graphing in MATLAB Note: All previous images were sourced from MathWorks website. Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

28 MATLAB Toolboxes MATLAB Toolboxes Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

29 MATLAB Toolboxes Toolboxes I MATLAB s core functionality is extended via toolboxes in the following areas: Math, Statistics, and Optimization Symbolic Math, PDEs, Statistics, Optimization, etc. Control Systems System Identification, Robust Control, Aerospace, Robotics Systems, etc. Signal Processing and Communications Signal Processing, Communications, Wavelet, Antenna, etc. Image Processing and Computer Vision Image Processing, Image Acquisition, Computer Vision, Mapping, etc. Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

30 MATLAB Toolboxes Toolboxes II Test and Measurement Data Acquisition, Instrument Control, etc. Computational Finance Financial, Econometrics, Datafeed, Trading, etc. Computational Biology Event-Based Modeling Physical Modeling Real-Time Simulation and Testing Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

31 Short MATLAB Demonstration Short MATLAB Demonstration Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

32 Demo transcript Short MATLAB Demonstration Let us fire-up MATLAB now... Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

33 Demo transcript I Short MATLAB Demonstration MATLAB code 1 %% Getting started 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3 4 % Lines starting with a "%" character signify comments and MATLAB 5 % ignores them 6 7 % Prints out MATLAB version number 8 ver 9 10 % See how fast your computer is 11 bench % Clear command window 14 clc % Help! 17 help 18 Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

34 Demo transcript II Short MATLAB Demonstration 19 % Get "man-page" quality help regarding a specific command... (here, "clc") 20 help clc % Get more information on a command (here, "clc") through the... help browser 23 doc clc % look for information on a topic 26 lookfor 'clear command window' % See what variables are currently available in the workspace 29 who 30 a = 1 % prints out variable value 31 a = 2; % ';' suppresses the printing out of variable value 32 who % Clear all variables from workspace 35 clear 36 who 37 Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

35 Demo transcript III Short MATLAB Demonstration 38 % Have some fun with MATLAB Easter eggs such as this one 39 why %% Some simple code snippets 43 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % About functions 46 help myfactorial % prints out the first comment lines in... myfactorial.m 47 type myfactorial % dumps the contents of myfactorial.m onto the... screen 48 edit myfactorial % bring myfactorial.m into the editor 49 N = randi(5); % call built-in function randi() to get a random... integer 50 myfactorial(n) % N! = 1*2*...*N % For-loops vs. vectorized operations 53 N = ; 54 x = 1 : N; % x == [ N] 55 tstart = tic; % tic is a built in function Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

36 Demo transcript IV Short MATLAB Demonstration 56 for i = 1 : N 57 x(i) = x(i)ˆ2; % call to built-in function randn() 58 end % i-loop 59 telapsed = toc(tstart) % elapsed time since tic call in seconds x = 1 : N; 62 tstart2 = tic; 63 x = x.ˆ 2; % avoiding for-loops via use of vectorized operations 64 telapsed2 = toc(tstart2) % is faster %% Sample computations 68 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Linear algebra computations 71 b = [ 3 3 ]' % transposition of a row vector gives a column vector 72 A = [ 2 1; 1 2] 73 det(a) % determinant 74 inv(a) % inverse matrix 75 x = A\b % solve A * x = b equation 76 Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

37 Demo transcript V Short MATLAB Demonstration 77 % Computing roots of polynomials 78 c = [1-2 1]; 79 roots(c) % roots of the polynomial c(1)*xˆ2 + c(2)*x + c(3) % Numerically integrating a function 82 fun exp(-0.5 * x.ˆ2); % a Gaussian function 83 integral(fun,-inf,inf) % == sqrt(2 * pi) %% Some plots 87 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 2D plot 90 % Inspired by 91 % 2001-what-matlab-easter-eggs-do-you-know 92 h = figure; % get figure handle 93 set(h, 'color', 'white') % set figure background to white 94 x = -2.0 :.001 : 2.0; 95 y = (real(sqrt(cos(x))).* cos(200*x) + sqrt(abs(x)) -0.7 ) % use... to continue on next line 97.* (4 - x.*x).ˆ 0.01; Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

38 Demo transcript VI Short MATLAB Demonstration 98 plot(x, y, 'red'); % plot curve 99 xlabel('x') % label the x axis as 'x' 100 ylabel('y') % label the y axis as 'y' 101 title('a heart') % add a figure title 102 axis equal % force same scaling to both axes % 2D animation 105 x = 0 : 10 : 360; % angle measured in degrees 106 y = sind(x); % sind: sine function accepting arguments in degrees 107 phi=0; 108 disp('press Ctrl-C to stop animation') % display message on screen 109 while 1 % infinite loop to animate the sine curve 110 phi = phi + 1; 111 ya = y * sind(phi); % change amplitude of sinusoid 112 plot(x, ya); % plot the curve 113 axis([0, 360, -1.1, 1.1]); % set axix limits 114 pause(0.005); % slow down animation 115 end % 3D interpolated surface plot (can be rotated) 118 logo Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

39 Demo transcript VII Short MATLAB Demonstration %% Some pre-built GUIs 122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Example of a GUI 125 xpbombs % mine sweeper! % Another GUI example 128 lorenz % orbits around the Lorenz chaotic attractor % quit MATLAB 131 quit Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

40 Alternatives to MATLAB Alternatives to MATLAB Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

41 MATLAB Alternatives Alternatives to MATLAB 1 Free, open-source, direct alternatives GNU Octave [Octave(2015)] SciLab [Scilab(2015)] FreeMat [FreeMat(2015)] 2 Free, open-source, somewhat similar alternatives R Project [R(2015)] SciPy [SciPy(2015)] SageMath [Sage(2015)] Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

42 Alternatives to MATLAB Regarding GNU Octave Core syntax and functionalities identical to MATLAB s Used to be command-line-only, now has GUI Major Pros/Cons: free/slower than MATLAB Figure: GNU Octave GUI screenshot Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

43 References References Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

44 References References I FreeMat. Freemat sourceforge website, URL MathWorks. Mathworks official website, 2015a. URL MathWorks. Matlab central file exchange, 2015b. URL GNU Octave. Gnu octave official website, URL R. R project official website, URL Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

45 References References II Sage. Sagemath official website, URL Scilab. Scilab official website, URL SciPy. Scipy official website, URL Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

46 Epilogue Epilogue Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

47 Epilogue Q&A I will be happy to entertain a few quick questions... Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

48 Epilogue Thanks! Thank you for having me in this workshop series! Anagnostopoulos A Brief Introduction to MATLAB November 4 th, / 48

System Design S.CS301

System Design S.CS301 System Design S.CS301 (Autumn 2015/16) Page 1 Agenda Contents: Course overview Reading materials What is the MATLAB? MATLAB system History of MATLAB License of MATLAB Release history Syntax of MATLAB (Autumn

More information

MatLab Just a beginning

MatLab Just a beginning MatLab Just a beginning P.Kanungo Dept. of E & TC, C.V. Raman College of Engineering, Bhubaneswar Introduction MATLAB is a high-performance language for technical computing. MATLAB is an acronym for MATrix

More information

MATLAB INTRODUCTION. Risk analysis lab Ceffer Attila. PhD student BUTE Department Of Networked Systems and Services

MATLAB INTRODUCTION. Risk analysis lab Ceffer Attila. PhD student BUTE Department Of Networked Systems and Services MATLAB INTRODUCTION Risk analysis lab 2018 2018. szeptember 10., Budapest Ceffer Attila PhD student BUTE Department Of Networked Systems and Services ceffer@hit.bme.hu Előadó képe MATLAB Introduction 2

More information

Introduction to MATLAB

Introduction to MATLAB ELG 3125 - Lab 1 Introduction to MATLAB TA: Chao Wang (cwang103@site.uottawa.ca) 2008 Fall ELG 3125 Signal and System Analysis P. 1 Do You Speak MATLAB? MATLAB - The Language of Technical Computing ELG

More information

A Guide to Using Some Basic MATLAB Functions

A Guide to Using Some Basic MATLAB Functions A Guide to Using Some Basic MATLAB Functions UNC Charlotte Robert W. Cox This document provides a brief overview of some of the essential MATLAB functionality. More thorough descriptions are available

More information

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

MATLAB Tutorial EE351M DSP. Created: Thursday Jan 25, 2007 Rayyan Jaber. Modified by: Kitaek Bae. Outline MATLAB Tutorial EE351M DSP Created: Thursday Jan 25, 2007 Rayyan Jaber Modified by: Kitaek Bae Outline Part I: Introduction and Overview Part II: Matrix manipulations and common functions Part III: Plots

More information

Constraint-based Metabolic Reconstructions & Analysis H. Scott Hinton. Matlab Tutorial. Lesson: Matlab Tutorial

Constraint-based Metabolic Reconstructions & Analysis H. Scott Hinton. Matlab Tutorial. Lesson: Matlab Tutorial 1 Matlab Tutorial 2 Lecture Learning Objectives Each student should be able to: Describe the Matlab desktop Explain the basic use of Matlab variables Explain the basic use of Matlab scripts Explain the

More information

MATLAB The first steps. Edited by Péter Vass

MATLAB The first steps. Edited by Péter Vass MATLAB The first steps Edited by Péter Vass MATLAB The name MATLAB is derived from the expression MATrix LABoratory. It is used for the identification of a software and a programming language. As a software,

More information

Table of Contents. Introduction.*.. 7. Part /: Getting Started With MATLAB 5. Chapter 1: Introducing MATLAB and Its Many Uses 7

Table of Contents. Introduction.*.. 7. Part /: Getting Started With MATLAB 5. Chapter 1: Introducing MATLAB and Its Many Uses 7 MATLAB Table of Contents Introduction.*.. 7 About This Book 1 Foolish Assumptions 2 Icons Used in This Book 3 Beyond the Book 3 Where to Go from Here 4 Part /: Getting Started With MATLAB 5 Chapter 1:

More information

Introduction to MATLAB

Introduction to MATLAB Chapter 1 Introduction to MATLAB 1.1 Software Philosophy Matrix-based numeric computation MATrix LABoratory built-in support for standard matrix and vector operations High-level programming language Programming

More information

INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX

INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX 1) Objective The objective of this lab is to review how to access Matlab, Simulink, and the Communications Toolbox, and to become familiar

More information

Dr Richard Greenaway

Dr Richard Greenaway SCHOOL OF PHYSICS, ASTRONOMY & MATHEMATICS 4PAM1008 MATLAB 2 Basic MATLAB Operation Dr Richard Greenaway 2 Basic MATLAB Operation 2.1 Overview 2.1.1 The Command Line In this Workshop you will learn how

More information

What is MATLAB? What is MATLAB? Programming Environment MATLAB PROGRAMMING. Stands for MATrix LABoratory. A programming environment

What is MATLAB? What is MATLAB? Programming Environment MATLAB PROGRAMMING. Stands for MATrix LABoratory. A programming environment What is MATLAB? MATLAB PROGRAMMING Stands for MATrix LABoratory A software built around vectors and matrices A great tool for numerical computation of mathematical problems, such as Calculus Has powerful

More information

Introduction to. The Help System. Variable and Memory Management. Matrices Generation. Interactive Calculations. Vectors and Matrices

Introduction to. The Help System. Variable and Memory Management. Matrices Generation. Interactive Calculations. Vectors and Matrices Introduction to Interactive Calculations Matlab is interactive, no need to declare variables >> 2+3*4/2 >> V = 50 >> V + 2 >> V Ans = 52 >> a=5e-3; b=1; a+b Most elementary functions and constants are

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab Matlab (MATrix LABoratory) will be the programming environment of choice for the numerical solutions developed in this textbook due to its wide availability and its ease of use.

More information

Lecture 1: What is MATLAB?

Lecture 1: What is MATLAB? Lecture 1: What is MATLAB? Dr. Mohammed Hawa Electrical Engineering Department University of Jordan EE201: Computer Applications. See Textbook Chapter 1. MATLAB MATLAB (MATrix LABoratory) is a numerical

More information

MATLAB 7. The Language of Technical Computing KEY FEATURES

MATLAB 7. The Language of Technical Computing KEY FEATURES MATLAB 7 The Language of Technical Computing MATLAB is a high-level technical computing language and interactive environment for algorithm development, data visualization, data analysis, and numerical

More information

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

Matlab Tutorial. The value assigned to a variable can be checked by simply typing in the variable name: 1 Matlab Tutorial 1- What is Matlab? Matlab is a powerful tool for almost any kind of mathematical application. It enables one to develop programs with a high degree of functionality. The user can write

More information

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

Lab of COMP 406. MATLAB: Quick Start. Lab tutor : Gene Yu Zhao Mailbox: or Lab 1: 11th Sep, 2013 Lab of COMP 406 MATLAB: Quick Start Lab tutor : Gene Yu Zhao Mailbox: csyuzhao@comp.polyu.edu.hk or genexinvivian@gmail.com Lab 1: 11th Sep, 2013 1 Where is Matlab? Find the Matlab under the folder 1.

More information

Introduction to MATLAB Practical 1

Introduction to MATLAB Practical 1 Introduction to MATLAB Practical 1 Daniel Carrera November 2016 1 Introduction I believe that the best way to learn Matlab is hands on, and I tried to design this practical that way. I assume no prior

More information

Fall 2014 MAT 375 Numerical Methods. Introduction to Programming using MATLAB

Fall 2014 MAT 375 Numerical Methods. Introduction to Programming using MATLAB Fall 2014 MAT 375 Numerical Methods Introduction to Programming using MATLAB Some useful links 1 The MOST useful link: www.google.com 2 MathWorks Webcite: www.mathworks.com/help/matlab/ 3 Wikibooks on

More information

MATLAB Basics. Configure a MATLAB Package 6/7/2017. Stanley Liang, PhD York University. Get a MATLAB Student License on Matworks

MATLAB Basics. Configure a MATLAB Package 6/7/2017. Stanley Liang, PhD York University. Get a MATLAB Student License on Matworks MATLAB Basics Stanley Liang, PhD York University Configure a MATLAB Package Get a MATLAB Student License on Matworks Visit MathWorks at https://www.mathworks.com/ It is recommended signing up with a student

More information

Chapter 2. MathScript

Chapter 2. MathScript Chapter 2. MathScript 2.1 What is MathScript MathScript is math-oriented, text-based computing language to address tasks mathematic calculation: Most suitable for Mathematic calculation. Matrix based data

More information

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

MATLAB is a multi-paradigm numerical computing environment fourth-generation programming language. A proprietary programming language developed by 1 MATLAB is a multi-paradigm numerical computing environment fourth-generation programming language. A proprietary programming language developed by MathWorks In 2004, MATLAB had around one million users

More information

Getting started with MATLAB

Getting started with MATLAB Sapienza University of Rome Department of economics and law Advanced Monetary Theory and Policy EPOS 2013/14 Getting started with MATLAB Giovanni Di Bartolomeo giovanni.dibartolomeo@uniroma1.it Outline

More information

Chapter 1 Introduction to MATLAB

Chapter 1 Introduction to MATLAB Chapter 1 Introduction to MATLAB 1.1 What is MATLAB? MATLAB = MATrix LABoratory, the language of technical computing, modeling and simulation, data analysis and processing, visualization and graphics,

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB (MATrix LABoratory) Presented By: Dr Mostafa Elshahed Asst. Prof. 1 Upon completing this course, the student should be able to: Learn a brief introduction to programming in MATLAB.

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Chen Huang Computer Science and Engineering SUNY at Buffalo What is MATLAB? MATLAB (stands for matrix laboratory ) It is a language and an environment for technical computing Designed

More information

Introduction to MATLAB for Numerical Analysis and Mathematical Modeling. Selis Önel, PhD

Introduction to MATLAB for Numerical Analysis and Mathematical Modeling. Selis Önel, PhD Introduction to MATLAB for Numerical Analysis and Mathematical Modeling Selis Önel, PhD Advantages over other programs Contains large number of functions that access numerical libraries (LINPACK, EISPACK)

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Contents 1.1 Objectives... 1 1.2 Lab Requirement... 1 1.3 Background of MATLAB... 1 1.4 The MATLAB System... 1 1.5 Start of MATLAB... 3 1.6 Working Modes of MATLAB... 4 1.7 Basic

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Introduction MATLAB is an interactive package for numerical analysis, matrix computation, control system design, and linear system analysis and design available on most CAEN platforms

More information

Introduction to MatLab. Introduction to MatLab K. Craig 1

Introduction to MatLab. Introduction to MatLab K. Craig 1 Introduction to MatLab Introduction to MatLab K. Craig 1 MatLab Introduction MatLab and the MatLab Environment Numerical Calculations Basic Plotting and Graphics Matrix Computations and Solving Equations

More information

Introduction to MATLAB Programming

Introduction to MATLAB Programming Introduction to MATLAB Programming Arun A. Balakrishnan Asst. Professor Dept. of AE&I, RSET Overview 1 Overview 2 Introduction 3 Getting Started 4 Basics of Programming Overview 1 Overview 2 Introduction

More information

Introduction to MATLAB. Simon O Keefe Non-Standard Computation Group

Introduction to MATLAB. Simon O Keefe Non-Standard Computation Group Introduction to MATLAB Simon O Keefe Non-Standard Computation Group sok@cs.york.ac.uk Content n An introduction to MATLAB n The MATLAB interfaces n Variables, vectors and matrices n Using operators n Using

More information

MATLAB. Devon Cormack and James Staley

MATLAB. Devon Cormack and James Staley MATLAB Devon Cormack and James Staley MATrix LABoratory Originally developed in 1970s as a FORTRAN wrapper, later rewritten in C Designed for the purpose of high-level numerical computation, visualization,

More information

Appendix A. Introduction to MATLAB. A.1 What Is MATLAB?

Appendix A. Introduction to MATLAB. A.1 What Is MATLAB? Appendix A Introduction to MATLAB A.1 What Is MATLAB? MATLAB is a technical computing environment developed by The Math- Works, Inc. for computation and data visualization. It is both an interactive system

More information

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

Computational Photonics, Summer Term 2014, Abbe School of Photonics, FSU Jena, Prof. Thomas Pertsch Computational Photonics Seminar 01, 14 April 2014 What is MATLAB? tool for numerical computing integrated environment for computation, visualization and programming at the same time higher level programming

More information

ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah)

ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah) Introduction ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah) MATLAB is a powerful mathematical language that is used in most engineering companies today. Its strength lies

More information

Introduzione a MatLab. Prof. Sebastiano Battiato

Introduzione a MatLab. Prof. Sebastiano Battiato Introduzione a MatLab Prof. Sebastiano Battiato MatLab Environment MATLAB Matlab = Matrix Laboratory Originally a user interface for numerical linear algebra routines (Lapak/Linpak) Commercialized 1984

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab Andreas C. Kapourani (Credit: Steve Renals & Iain Murray) 9 January 08 Introduction MATLAB is a programming language that grew out of the need to process matrices. It is used extensively

More information

Lecturer: Keyvan Dehmamy

Lecturer: Keyvan Dehmamy MATLAB Tutorial Lecturer: Keyvan Dehmamy 1 Topics Introduction Running MATLAB and MATLAB Environment Getting help Variables Vectors, Matrices, and linear Algebra Mathematical Functions and Applications

More information

2.0 MATLAB Fundamentals

2.0 MATLAB Fundamentals 2.0 MATLAB Fundamentals 2.1 INTRODUCTION MATLAB is a computer program for computing scientific and engineering problems that can be expressed in mathematical form. The name MATLAB stands for MATrix LABoratory,

More information

What is Matlab? A software environment for interactive numerical computations

What is Matlab? A software environment for interactive numerical computations What is Matlab? A software environment for interactive numerical computations Examples: Matrix computations and linear algebra Solving nonlinear equations Numerical solution of differential equations Mathematical

More information

Introduction to Mathematical Programming

Introduction to Mathematical Programming Introduction to Mathematical Programming Ming Zhong Lecture 3 September 5, 2018 Ming Zhong (JHU) AMS Fall 2018 1 / 14 Programming with MATLAB Table of Contents 1 Programming with MATLAB 2 Logic, Loops

More information

Stokes Modelling Workshop

Stokes Modelling Workshop Stokes Modelling Workshop 14/06/2016 Introduction to Matlab www.maths.nuigalway.ie/modellingworkshop16/files 14/06/2016 Stokes Modelling Workshop Introduction to Matlab 1 / 16 Matlab As part of this crash

More information

MATLAB 7 Getting Started Guide

MATLAB 7 Getting Started Guide MATLAB 7 Getting Started Guide How to Contact The MathWorks www.mathworks.com Web comp.soft-sys.matlab Newsgroup www.mathworks.com/contact_ts.html Technical Support suggest@mathworks.com bugs@mathworks.com

More information

University of Alberta

University of Alberta A Brief Introduction to MATLAB University of Alberta M.G. Lipsett 2008 MATLAB is an interactive program for numerical computation and data visualization, used extensively by engineers for analysis of systems.

More information

Evolutionary Algorithms. Workgroup 1

Evolutionary Algorithms. Workgroup 1 The workgroup sessions Evolutionary Algorithms Workgroup Workgroup 1 General The workgroups are given by: Hao Wang - h.wang@liacs.leideuniv.nl - Room 152 Furong Ye - f.ye@liacs.leidenuniv.nl Follow the

More information

Basic MATLAB Tutorial

Basic MATLAB Tutorial Basic MATLAB Tutorial http://www1gantepedutr/~bingul/ep375 http://wwwmathworkscom/products/matlab This is a basic tutorial for the Matlab program which is a high-performance language for technical computing

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab The purpose of this intro is to show some of Matlab s basic capabilities. Nir Gavish, 2.07 Contents Getting help Matlab development enviroment Variable definitions Mathematical operations

More information

Introduction to MATLAB. Arturo Donate

Introduction to MATLAB. Arturo Donate Introduction to MATLAB Arturo Donate Introduction What is MATLAB? Environment MATLAB Basics Toolboxes Comparison Conclusion Programming What is MATLAB? Matrix laboratory programming environment high-performance

More information

MATLAB Tutorial. Digital Signal Processing. Course Details. Topics. MATLAB Environment. Introduction. Digital Signal Processing (DSP)

MATLAB Tutorial. Digital Signal Processing. Course Details. Topics. MATLAB Environment. Introduction. Digital Signal Processing (DSP) Digital Signal Processing Prof. Nizamettin AYDIN naydin@yildiz.edu.tr naydin@ieee.org http://www.yildiz.edu.tr/~naydin Course Details Course Code : 0113620 Course Name: Digital Signal Processing (Sayısal

More information

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing SECTION 1: INTRODUCTION ENGR 112 Introduction to Engineering Computing 2 Course Overview What is Programming? 3 Programming The implementation of algorithms in a particular computer programming language

More information

Introduction to Scilab Use Scilab, not Matlab

Introduction to Scilab Use Scilab, not Matlab Introduction to Scilab Use Scilab, not Matlab Kannan M. Moudgalya IIT Bombay kannan@iitb.ac.in Scilab-Arduino Workshop IIT Bombay 3 July 2015 Kannan Moudgalya Use Scilab, not Matlab 1/68 Outline Open Source

More information

Introduction to Computer Programming with MATLAB Matlab Fundamentals. Selis Önel, PhD

Introduction to Computer Programming with MATLAB Matlab Fundamentals. Selis Önel, PhD Introduction to Computer Programming with MATLAB Matlab Fundamentals Selis Önel, PhD Today you will learn to create and execute simple programs in MATLAB the difference between constants, variables and

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Zhiyu Zhao (sylvia@cs.uno.edu) The LONI Institute & Department of Computer Science College of Sciences University of New Orleans 03/02/2009 Outline What is MATLAB Getting Started

More information

LAB 1 General MATLAB Information 1

LAB 1 General MATLAB Information 1 LAB 1 General MATLAB Information 1 General: To enter a matrix: > type the entries between square brackets, [...] > enter it by rows with elements separated by a space or comma > rows are terminated by

More information

Introduction to Octave/Matlab. Deployment of Telecommunication Infrastructures

Introduction to Octave/Matlab. Deployment of Telecommunication Infrastructures Introduction to Octave/Matlab Deployment of Telecommunication Infrastructures 1 What is Octave? Software for numerical computations and graphics Particularly designed for matrix computations Solving equations,

More information

Introduction to Matlab. Summer School CEA-EDF-INRIA 2011 of Numerical Analysis

Introduction to Matlab. Summer School CEA-EDF-INRIA 2011 of Numerical Analysis Introduction to Matlab 1 Outline What is Matlab? Matlab desktop & interface Scalar variables Vectors and matrices Exercise 1 Booleans Control structures File organization User defined functions Exercise

More information

Introduction to Scilab

Introduction to Scilab Introduction to Scilab Kannan M. Moudgalya IIT Bombay www.moudgalya.org kannan@iitb.ac.in Scilab Workshop Bhaskaracharya Pratishtana 4 July 2009 Kannan Moudgalya Introduction to Scilab 1/52 Outline Software

More information

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER BENC 2113 DENC ECADD 2532 ECADD LAB SESSION 6/7 LAB

More information

MATLAB Project: Getting Started with MATLAB

MATLAB Project: Getting Started with MATLAB Name Purpose: To learn to create matrices and use various MATLAB commands for reference later MATLAB built-in functions used: [ ] : ; + - * ^, size, help, format, eye, zeros, ones, diag, rand, round, cos,

More information

The Cantor Handbook. Alexander Rieder

The Cantor Handbook. Alexander Rieder Alexander Rieder 2 Contents 1 Introduction 5 2 Using Cantor 6 2.1 Cantor features....................................... 6 2.2 The Cantor backends.................................... 7 2.3 The Cantor Workspace...................................

More information

PROGRAMMING WITH MATLAB DR. AHMET AKBULUT

PROGRAMMING WITH MATLAB DR. AHMET AKBULUT PROGRAMMING WITH MATLAB DR. AHMET AKBULUT OVERVIEW WEEK 1 What is MATLAB? A powerful software tool: Scientific and engineering computations Signal processing Data analysis and visualization Physical system

More information

MATH 5520 Basics of MATLAB

MATH 5520 Basics of MATLAB MATH 5520 Basics of MATLAB Dmitriy Leykekhman Spring 2011 Topics Sources. Entering Matrices. Basic Operations with Matrices. Build in Matrices. Build in Scalar and Matrix Functions. if, while, for m-files

More information

MATH 3511 Basics of MATLAB

MATH 3511 Basics of MATLAB MATH 3511 Basics of MATLAB Dmitriy Leykekhman Spring 2012 Topics Sources. Entering Matrices. Basic Operations with Matrices. Build in Matrices. Build in Scalar and Matrix Functions. if, while, for m-files

More information

Objectives. 1 Running, and Interface Layout. 2 Toolboxes, Documentation and Tutorials. 3 Basic Calculations. PS 12a Laboratory 1 Spring 2014

Objectives. 1 Running, and Interface Layout. 2 Toolboxes, Documentation and Tutorials. 3 Basic Calculations. PS 12a Laboratory 1 Spring 2014 PS 12a Laboratory 1 Spring 2014 Objectives This session is a tutorial designed to a very quick overview of some of the numerical skills that you ll need to get started. Throughout the tutorial, the instructors

More information

A Tour of Matlab for Math 496, Section 6

A Tour of Matlab for Math 496, Section 6 A Tour of Matlab for Math 496, Section 6 Thomas Shores Department of Mathematics University of Nebraska Spring 2006 What is Matlab? Matlab is 1. An interactive system for numerical computation. 2. A programmable

More information

Matlab Tutorial, CDS

Matlab Tutorial, CDS 29 September 2006 Arrays Built-in variables Outline Operations Linear algebra Polynomials Scripts and data management Help: command window Elisa (see Franco next slide), Matlab Tutorial, i.e. >> CDS110-101

More information

Outline. CSE 1570 Interacting with MATLAB. Starting MATLAB. Outline. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An.

Outline. CSE 1570 Interacting with MATLAB. Starting MATLAB. Outline. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An. CSE 170 Interacting with MATLAB Instructor: Aijun An Department of Computer Science and Engineering York University aan@cse.yorku.ca Outline Starting MATLAB MATLAB Windows Using the Command Window Some

More information

Outline. CSE 1570 Interacting with MATLAB. Outline. Starting MATLAB. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An.

Outline. CSE 1570 Interacting with MATLAB. Outline. Starting MATLAB. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An. CSE 10 Interacting with MATLAB Instructor: Aijun An Department of Computer Science and Engineering York University aan@cse.yorku.ca Outline Starting MATLAB MATLAB Windows Using the Command Window Some

More information

Introduction to Matlab. By: Dr. Maher O. EL-Ghossain

Introduction to Matlab. By: Dr. Maher O. EL-Ghossain Introduction to Matlab By: Dr. Maher O. EL-Ghossain Outline: q What is Matlab? Matlab Screen Variables, array, matrix, indexing Operators (Arithmetic, relational, logical ) Display Facilities Flow Control

More information

CDA6530: Performance Models of Computers and Networks. Chapter 4: Using Matlab for Performance Analysis and Simulation

CDA6530: Performance Models of Computers and Networks. Chapter 4: Using Matlab for Performance Analysis and Simulation CDA6530: Performance Models of Computers and Networks Chapter 4: Using Matlab for Performance Analysis and Simulation Objective Learn a useful tool for mathematical analysis and simulation Interpreted

More information

Why use MATLAB? Mathematcal computations. Used a lot for problem solving. Statistical Analysis (e.g., mean, min) Visualisation (1D-3D)

Why use MATLAB? Mathematcal computations. Used a lot for problem solving. Statistical Analysis (e.g., mean, min) Visualisation (1D-3D) MATLAB(motivation) Why use MATLAB? Mathematcal computations Used a lot for problem solving Statistical Analysis (e.g., mean, min) Visualisation (1D-3D) Signal processing (Fourier transform, etc.) Image

More information

Finding, Starting and Using Matlab

Finding, Starting and Using Matlab Variables and Arrays Finding, Starting and Using Matlab CSC March 6 &, 9 Array: A collection of data values organized into rows and columns, and known by a single name. arr(,) Row Row Row Row 4 Col Col

More information

Part #1. A0B17MTB Matlab. Miloslav Čapek Filip Kozák, Viktor Adler, Pavel Valtr

Part #1. A0B17MTB Matlab. Miloslav Čapek Filip Kozák, Viktor Adler, Pavel Valtr A0B17MTB Matlab Part #1 Miloslav Čapek miloslav.capek@fel.cvut.cz Filip Kozák, Viktor Adler, Pavel Valtr Department of Electromagnetic Field B2-626, Prague You will learn Scalars, vectors, matrices (class

More information

Introduction to MATLAB

Introduction to MATLAB to MATLAB Spring 2019 to MATLAB Spring 2019 1 / 39 The Basics What is MATLAB? MATLAB Short for Matrix Laboratory matrix data structures are at the heart of programming in MATLAB We will consider arrays

More information

This is a basic tutorial for the MATLAB program which is a high-performance language for technical computing for platforms:

This is a basic tutorial for the MATLAB program which is a high-performance language for technical computing for platforms: Appendix A Basic MATLAB Tutorial Extracted from: http://www1.gantep.edu.tr/ bingul/ep375 http://www.mathworks.com/products/matlab A.1 Introduction This is a basic tutorial for the MATLAB program which

More information

INTRODUCTION TO MATLAB

INTRODUCTION TO MATLAB 1 of 18 BEFORE YOU BEGIN PREREQUISITE LABS None EXPECTED KNOWLEDGE Algebra and fundamentals of linear algebra. EQUIPMENT None MATERIALS None OBJECTIVES INTRODUCTION TO MATLAB After completing this lab

More information

An Introduction to Matlab for DSP

An Introduction to Matlab for DSP Brady Laska Carleton University September 13, 2007 Overview 1 Matlab background 2 Basic Matlab 3 DSP functions 4 Coding for speed 5 Demos Accessing Matlab Labs on campus Purchase it commercial editions

More information

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

How to Use MATLAB. What is MATLAB. Getting Started. Online Help. General Purpose Commands How to Use MATLAB What is MATLAB MATLAB is an interactive package for numerical analysis, matrix computation, control system design and linear system analysis and design. On the server bass, MATLAB version

More information

CE890 / ENE801 Lecture 1 Introduction to MATLAB

CE890 / ENE801 Lecture 1 Introduction to MATLAB CE890 / ENE801 Lecture 1 Introduction to MATLAB CE890: Course Objectives Become familiar with a powerful tool for computations and visualization (MATLAB) Promote problem-solving skills using computers

More information

Getting started with Matlab: Outline

Getting started with Matlab: Outline Getting started with Matlab: Outline What, where and why of matlab. The matlab desktop and you Entering commands Variables and data types Plotting 101 Saving and loading data A real world example What

More information

What is MATLAB? It is a high-level programming language. for numerical computations for symbolic computations for scientific visualizations

What is MATLAB? It is a high-level programming language. for numerical computations for symbolic computations for scientific visualizations What is MATLAB? It stands for MATrix LABoratory It is developed by The Mathworks, Inc (http://www.mathworks.com) It is an interactive, integrated, environment for numerical computations for symbolic computations

More information

Trouble with Toolboxes. Michael Croucher (University of Manchester)

Trouble with Toolboxes. Michael Croucher (University of Manchester) Trouble with Toolboxes Michael Croucher (University of Manchester) Michael.Croucher@manchester.ac.uk www.walkingrandomly.com My background PhD Computational Physics from Sheffield University Support scientific

More information

Using MATLAB, SIMULINK and Control System Toolbox

Using MATLAB, SIMULINK and Control System Toolbox Using MATLAB, SIMULINK and Control System Toolbox A practical approach Alberto Cavallo Roberto Setola Francesco Vasca Prentice Hall London New York Toronto Sydney Tokyo Singapore Madrid Mexico City Munich

More information

Introduction in MATLAB (TSRT04)

Introduction in MATLAB (TSRT04) VT2 2019 Division of Communication Systems Department of Electrical Engineering (ISY) Linköping University, Sweden www.commsys.isy.liu.se/en/student/kurser/tsrt04 About the Course MATLAB Basics Vectors

More information

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

3 An Introductory Demonstration Execute the following command to view a quick introduction to Matlab. >> intro (Use your mouse to position windows on Department of Electrical Engineering EE281 Introduction to MATLAB on the Region IV Computing Facilities 1 What is Matlab? Matlab is a high-performance interactive software package for scientic and enginnering

More information

MATLAB Introduction. Ron Ilizarov Application Engineer

MATLAB Introduction. Ron Ilizarov Application Engineer MATLAB Introduction Ron Ilizarov Application Engineer 1 What is MATLAB? High-level language Interactive development environment Used for: Numerical computation Data analysis and visualization Algorithm

More information

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

Lab. Manual. Practical Special Topics (Matlab Programming) (EngE416) Prepared By Dr. Emad Saeid KINGDOM OF SAUDI ARABIA JAZAN UNIVERSTY College of Engineering Electrical Engineering Department المملكة العربية السعودية وزارة التعليم العالي جامعة جازان كلية الھندسة قسم الھندسة الكھربائية Lab. Manual

More information

7 Control Structures, Logical Statements

7 Control Structures, Logical Statements 7 Control Structures, Logical Statements 7.1 Logical Statements 1. Logical (true or false) statements comparing scalars or matrices can be evaluated in MATLAB. Two matrices of the same size may be compared,

More information

Lab 1 Intro to MATLAB and FreeMat

Lab 1 Intro to MATLAB and FreeMat Lab 1 Intro to MATLAB and FreeMat Objectives concepts 1. Variables, vectors, and arrays 2. Plotting data 3. Script files skills 1. Use MATLAB to solve homework problems 2. Plot lab data and mathematical

More information

NAG at Manchester. Michael Croucher (University of Manchester)

NAG at Manchester. Michael Croucher (University of Manchester) NAG at Manchester Michael Croucher (University of Manchester) Michael.Croucher@manchester.ac.uk www.walkingrandomly.com Twitter: @walkingrandomly My background PhD Computational Physics from Sheffield

More information

MATLAB for Image Processing. April 2018 Rod Dockter

MATLAB for Image Processing. April 2018 Rod Dockter MATLAB for Image Processing April 2018 Rod Dockter Outline Introduction to MATLAB Basics & Examples Image Processing with MATLAB Basics & Examples What is MATLAB? MATLAB = Matrix Laboratory MATLAB is a

More information

EE 216 Experiment 1. MATLAB Structure and Use

EE 216 Experiment 1. MATLAB Structure and Use EE216:Exp1-1 EE 216 Experiment 1 MATLAB Structure and Use This first laboratory experiment is an introduction to the use of MATLAB. The basic computer-user interfaces, data entry techniques, operations,

More information

Introduction to MATLAB for CSE390

Introduction to MATLAB for CSE390 Introduction Introduction to MATLAB for CSE390 Professor Vijay Kumar Praveen Srinivasan University of Pennsylvania MATLAB is an interactive program designed for scientific computations, visualization and

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab Enrique Muñoz Ballester Dipartimento di Informatica via Bramante 65, 26013 Crema (CR), Italy enrique.munoz@unimi.it Contact Email: enrique.munoz@unimi.it Office: Room BT-43 Industrial,

More information

Eng Marine Production Management. Introduction to Matlab

Eng Marine Production Management. Introduction to Matlab Eng. 4061 Marine Production Management Introduction to Matlab What is Matlab? Matlab is a commercial "Matrix Laboratory" package which operates as an interactive programming environment. Matlab is available

More information

ECE Lesson Plan - Class 1 Fall, 2001

ECE Lesson Plan - Class 1 Fall, 2001 ECE 201 - Lesson Plan - Class 1 Fall, 2001 Software Development Philosophy Matrix-based numeric computation - MATrix LABoratory High-level programming language - Programming data type specification not

More information

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

MATH (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab MATH 495.3 (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab Below is a screen similar to what you should see when you open Matlab. The command window is the large box to the right containing the

More information