MATLAB Lecture 1 염익준. Introduction MATLAB (MATrix LABoratory) a special purpose computer program optimized to perform engineering and scientific calculations.

Slides:



Advertisements
Similar presentations
MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
Advertisements

Introduction to Matlab
Introduction to MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
1 Chapter 2 Basic Elements of Fortran Programming.
Introduction to MATLAB
MATLAB ME1107 Y Yan Reference: MATLAB for Engineers by Holly Moore (Pearson Prentice Hall)
MATLAB Basics CS 111 Introduction to Computing in Engineering and Science.
Introduction to MATLAB 7 for Engineers
EGR 106 Intro to Engineering II Engineering problem solving using MATLAB Text: Amos Gilat, MATLAB An Introduction with Applications, Wiley 2004 ISBN
Introduction to MATLAB ES 156 Signals and Systems 2007 Harvard SEAS Prepared by Jiajun Gu.
Introduction to MATLAB
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.
Introduction to MATLAB ENGR 1187 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
MATLAB and SimulinkLecture 11 To days Outline  Introduction  MATLAB Desktop  Basic Features  Branching Statements  Loops  Script file / Commando.
Predefined MATLAB Functions ELEC 206 Computer Applications for Electrical Engineers Dr. Ron Hayne.
MATLAB Tutorials Session I Introduction to MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU.
Introduction to Matlab 1. Outline: What is Matlab? Matlab Screen Variables, array, matrix, indexing Operators Plotting Flow Control Using of M-File Writing.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 MATLAB Programming Chapter 2.
REVIEW 2 Exam History of Computers 1. CPU stands for _______________________. a. Counter productive units b. Central processing unit c. Copper.
Introduction to MATLAB Computational Probability and Statistics CIS 2033 Section 003 Djordje Gligorijevic, Temple University, Fall 2015.
1 Lab of COMP 406 Teaching Assistant: Pei-Yuan Zhou Contact: Lab 1: 12 Sep., 2014 Introduction of Matlab (I)
Introduction to MATLAB CBE 502 Mathematical Methods of Engineering Analysis.
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB is a powerful program for numerical computations, plotting and programming.
Introduction to MATLAB ENGR 1181 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
Introduction to Engineering MATLAB – 1 Introduction to MATLAB Agenda Introduction Arithmetic Operations MATLAB Windows Command Window Defining Variables.
MATLAB An Introduction to MATLAB (Matrix Laboratory) 1.
Matlab for Engineers Built-in Matlab Functions Chapter 3.
EECE 360/460 Matlab Tutorial Jan Outline What is Matlab? What is Matlab? Matlab Interface Matlab Interface Basic Syntax Basic Syntax Plotting Graphs.
1 MATLAB Basics. 2 MATLAB Documentation /help/techdoc/ Matrix Algebra.
INTRODUCTION TO MATLAB LAB# 01
Lecture 1 - Introduction June 3, 2002 CVEN 302. Lecture’s Goals General Introduction to CVEN Computer Applications in Engineering and Construction.
1 Functions ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
MATLAB Environment ELEC 206 Computer Applications for Electrical Engineers Dr. Ron Hayne.
Introduction to Matlab
Introduction to MATLAB. CSPP58001 MATLAB MATLAB is is a matrix-based language well suited for carrying out numerical analysis. It has many, many high-
ME6104: CAD. Module 4. ME6104: CAD. Module 4. Systems Realization Laboratory Module 4 Matlab ME 6104 – Fundamentals of Computer-Aided Design.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 18P. 1Winter Quarter Introduction to MATLAB Lecture 18.
Working with Arrays in MATLAB
A string is an array of characters Strings have many uses in MATLAB Display text output Specify formatting for plots Input arguments for some functions.
Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz SUNY-New Paltz “Lecture 2”
(The Transpose Operator) 1 >> C=[ ; ; ] C = >> D=C' D =
A simple classification problem Extract attributes Pattern Pattern recognition decision x C1 C2.
EGR 115 Introduction to Computing for Engineers MATLAB Basics 2: Sub-Arrays Friday 05 Sept 2014 EGR 115 Introduction to Computing for Engineers.
EGR 115 Introduction to Computing for Engineers MATLAB Basics 1: Variables & Arrays Wednesday 03 Sept 2014 EGR 115 Introduction to Computing for Engineers.
Introduction to Matlab Patrice Koehl Department of Biological Sciences National University of Singapore
Program design and algorithm development We will consider the design of your own toolbox to be included among the toolboxes already available with your.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
Chapter 1 Computing Tools Variables, Scalars, and Arrays Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
ECE 1304 Introduction to Electrical and Computer Engineering
Introduction to MATLAB
Numeric, Cell and Structural Arrays One of the strenghts of MATLAB is the capabilty to handle collection of numbers called ARRAYS. MATLAB refers to scalars,
ECE 1304 Introduction to Electrical and Computer Engineering
Built-in MATLAB Functions Chapter 3
Introduction to Matlab
EGR 115 Introduction to Computing for Engineers
Lecture: MATLAB Chapter 1 Introduction
Computer Simulation Lab
2) Platform independent 3) Predefined functions
Outline Matlab tutorial How to start and exit Matlab Matlab basics.
MATLAB DENC 2533 ECADD LAB 9.
INTRODUCTION TO MATLAB AM2032 JAYANTA MUKHERJEE.
Use of Mathematics using Technology (Maltlab)
Lecture 2 Introduction to MATLAB
Experiment No. (1) - an introduction to MATLAB
Announcements P3 due today
CS 111 Introduction to Computing in Engineering and Science
MatLab Program Used to Calculate Interactive
Introduction to Matlab
Presentation transcript:

MATLAB Lecture 1 염익준

Introduction MATLAB (MATrix LABoratory) a special purpose computer program optimized to perform engineering and scientific calculations. implements the MATLAB programming language and provides a extensive library of predefined functions. 2

Advantages Ease of use Platform independence Predefined functions Device-independent plotting Graphical user interface MATLAB compiler 3

Disadvantages Cost GNU Octave for free 4

MATLAB Programming 5

Variables and Arrays The fundamental data unit is the array. classified as either vectors or matrices. Naming –must begin with a letter –only first 63 characters are significant –make sure uniqueness –give your variables descriptive and easy to remember names –create a data dictionary –case sensitive 6

Initializing Variables var = expression; var = 40i; var2 = var/5; x=1; y=2; array = [ ]; array2 = [1, 2, 3, 4]; array3 = [1 2 3; 4 5 6]; the number of elements in every row of an array must be the same, and so in every column. a = [0 1+7]; b = [a(2) 7 a]; 7

Initializing Variables with shortcut expressions –first:incr:last –x = 1:2:10 –y = 1:10 with built-in functions –a = zeros(2); –b = zeros(2, 3); –c = ones(3, 4); with Keyboard input –in1 = input(‘Enter data: ‘); –in2 = input(‘Enter data: ‘, ‘s’); 8

Multidimensional Arrays c(:,:,1) = [1 2 3; 4 5 6]; c(:,:,2) = [7 8 9; ]; Storing arrays in memory –column major order Accessing multidimensional arrays with one dimension 9

Subarrays limiting the range of an array –a = [1 2 3; 4 5 6; 7 8 9]; –b = a(1:2, 1:2); end keyword –c = a(2:end, 2:end); a(1:2, 1:2) = 1; 10

Special Values pi i, j inf: division by zero nan: not a number zero divided by zero clock date eps ans 11

Displaying Output Data str = ‘ikjun yeom’; disp(str); Formatted output –fprintf() 12

Data Files save and load 13

Operations For Arithmetic operations –a +b, a – b, a * b, a / b, a^b Array and matrix operations –+, -,.*, *,./,.\, /, \.^ Precedence –parentheses –exponentials –multiplications and divisions –additions and subtractions 14

Common Functions abs(x), acos(x), angle(x), asin(x), atan(x), cos(x), exp(x), log(x), max(x), min(x), mod(x, y), sqrt(x), tan(x) ceil(x), fix(x), floor(x), round(x) char(x), double(x), int2str(x), num2str(x), str2num(x) 15

Plotting x = 0:10; y = x.^2 – 10.*x + 15; plot(x, y) title, xlabel, ylabel, grid, hold, legend, xrange, yrange, etc.. 16

Debugging Syntax error run-time error logical error 17