Introduction to Engineering MATLAB – 1 Introduction to MATLAB Agenda Introduction Arithmetic Operations MATLAB Windows Command Window Defining Variables.

Slides:



Advertisements
Similar presentations
The TI-83 Plus Elementary Algebra Calculator Tutorial.
Advertisements

Introduction to Matlab. I use Matlab for: Data analysis Data plotting Image Analysis Also – Simulations (solving odes/pdes/finite element methods) – Minimisations,
MATLAB ME1107 Y Yan Reference: MATLAB for Engineers by Holly Moore (Pearson Prentice Hall)
Lecture 6 MATLAB functions Basics of Built-in Functions, Help Feature, Elementary Functions (e.g., Polynomials, Trigonometric Functions), Data Analysis,
Lab1 (Signal & System) Instructor: Anan Osothsilp Date: 30 Jan 07.
Introduction to MATLAB 7 for Engineers
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Dr. Jie Zou PHY Welcome to PHY 3320 Computational Methods in Physics and Engineering.
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.
Mathcad Variable Names A string of characters (including numbers and some “special” characters (e.g. #, %, _, and a few more) Cannot start with a number.
BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.
Martin Ellison University of Warwick and CEPR Bank of England, December 2005 Introduction to MATLAB.
THE MATLAB ENVIRONMENT VARIABLES BASIC COMMANDS HELP HP 100 – MATLAB Wednesday, 8/27/2014
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Matlab Review Exam 2 – Oct 28, Exam Reminders Open book. Only Matlab book, no notes or loose papers in book. Open book. Only Matlab book, no notes.
MATLAB Tutorials Session I Introduction to MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (2): MATLAB Environment (Chapter 1)
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Recap Graphic Window Edit Window Start Button Matrices in MATLAB Scalar Operations Order of Operations Array Operations Matrix Addition Matrix Multiplication.
1 Week 3: Vectors and Matrices (Part III) READING: 2.2 – 2.4 EECS Introduction to Computing for the Physical Sciences.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
1 Lab of COMP 406 Teaching Assistant: Pei-Yuan Zhou Contact: Lab 1: 12 Sep., 2014 Introduction of Matlab (I)
MEGN 536 – Computational Biomechanics MATLAB: Getting Started Prof. Anthony J. Petrella Computational Biomechanics Group.
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.
MATLAB An Introduction to MATLAB (Matrix Laboratory) 1.
EECE 360/460 Matlab Tutorial Jan Outline What is Matlab? What is Matlab? Matlab Interface Matlab Interface Basic Syntax Basic Syntax Plotting Graphs.
Release Numbers MATLAB is updated regularly The Mathworks packages their software in groups, called releases, New releases are issued twice a year in the.
Slide deck by Dr. Greg Reese Miami University MATLAB An Introduction With Applications, 5 th Edition Dr. Amos Gilat The Ohio State University Chapter 1.
MATLAB Basics. The following screen will appear when you start up Matlab. All of the commands that will be discussed should be typed at the >> prompt.
Lecture 1 - Introduction June 3, 2002 CVEN 302. Lecture’s Goals General Introduction to CVEN Computer Applications in Engineering and Construction.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Chapter 1 An Overview Of MATLAB. The default MATLAB Desktop. Figure 1.1–1 1-2 More? See pages 6-7.
Introduction to Engineering MATLAB – 2 Introduction to MATLAB - 2 Agenda Defining Variables MATLAB Windows.
CMPS 1371 Introduction to Computing for Engineers MatLab.
10/24/20151 Chapter 2 Review: MATLAB Environment Introduction to MATLAB 7 Engineering 161.
1 Math Expressions and Operators. 2 Some C++ Operators Precedence OperatorDescription Higher ( )Function call +Positive - Negative *Multiplication / Division.
Lecture 2 - Matlab Introduction CVEN 302 June 5, 2002.
Introduction to MATLAB ENGR 1181 MATLAB 1. Opening MATLAB  Students, please open MATLAB now.  CLICK on the shortcut icon → Alternatively, select… start/All.
1 Week 1: Variables, assignment, expressions READING: 1.2 – 1.4.
Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz SUNY-New Paltz “Lecture 2”
1 Lecture 1 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
EGR 115 Introduction to Computing for Engineers Introduction to MATLAB Friday 29 August 2014 EGR 115 Introduction to Computing for Engineers.
Interduction to MATLAB Manal Alotaibi Mathematics department College of science King saud university.
ENG 1181 First-Year Engineering Program College of Engineering Engineering Education Innovation Center First-Year Engineering Program MAT - Introduction.
Fundamentals of Programming 20-ENFD-112 Sections 001 to 007 Instructor: Prof. Dieter Schmidt Lecture: Monday, Wednesday 3:00-3:50 Web page
Today we will learn MATLAB Click Start  All programm  Class Software  Matlab This command window will be seen with a prompt sign >> Any command can.
Introduction to MATLAB 1.Basic functions 2.Vectors, matrices, and arithmetic 3.Flow Constructs (Loops, If, etc) 4.Create M-files 5.Plotting.
1 Lecture 3 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
29 January 2016Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems.
MATLAB Lecture 1 염익준. Introduction MATLAB (MATrix LABoratory) a special purpose computer program optimized to perform engineering and scientific calculations.
1 Faculty Name Prof. A. A. Saati. 2 MATLAB Fundamentals 3 1.Reading home works ( Applied Numerical Methods )  CHAPTER 2: MATLAB Fundamentals (p.24)
BASICS OF MATLAB Engr.Mian Shahzad Iqbal Lecturer,Telecom Department University of Engineering & Technology Taxila.
Array and Matrix Operations EE 201 Fall  Achieve Comprehension LOL of Array and Matrix Operations. Class Learning Objectives 2.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
Copyright © The McGraw-Hill Companies, Inc. This work is only for non-profit use by instructors in courses for which this textbook has been adopted.
Basic operations in Matlab EE 201.  Achieve Comprehension LOL of Matlab basic operations. Class Learning Objectives 2.
Introduction to MATLAB
ECE 1304 Introduction to Electrical and Computer Engineering
Arithmetic Operations
ECE 1304 Introduction to Electrical and Computer Engineering
BIL 104E Introduction to Scientific and Engineering Computing
Introduction to Programming
Experiment No. (1) - an introduction to MATLAB
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.
MatLab Program Used to Calculate Interactive
Introduction to Matlab
Electrical and Computer Engineering Department SUNY – New Paltz
Presentation transcript:

Introduction to Engineering MATLAB – 1 Introduction to MATLAB Agenda Introduction Arithmetic Operations MATLAB Windows Command Window Defining Variables

MATLAB is a software for numerical computations, graphing, and programming. The name MATLAB stands for MATrix LABoratory. Its basic data element is an array (explained later). With MATLAB you can:  Use it as a calculator.  Use built-in functions (sin, cos, max, min, etc.).  Define variables and use them in calculations.  Plot graphs.  Write and run computer programs.  Do symbolic calculations.

Help Window (The Help Window can be opened from the Help menu of any of the previous windows)

ARITHMETIC OPERATIONS SymbolOperation MATLAB Form + addition: a+ba+b - subtraction: a-ba-b * multiplication aba*b / right division: a/b =a/b (divides a by b) \ left division: a\b =a\b (divides b by a) ^ exponentiation: a b a^b NOTE: For scalars the arithmetic operations are the usual ones. For vectors and matrices the arithmetic operations can either follows matrix algebra rules, or can be performed on element-by-element basis (discussed in the next lecture).

ORDER Of PRECEDENCE (The order in which operations are executed by the computer) Higher-precedence operations are executed before lower- precedence operations. If two operations have the same precedence, then the expression is executed from left to right. PRECEDENCEOPERATION FirstParentheses, starting with the innermost pair. SecondExponentiation. ThirdMultiplication and division (equal precedence). FourthAddition and subtraction (equal precedence).

The format command controls how output numbers appear on the screen. Input numbers can be written in any format. format short (default) four decimal digits. format long sixteen digits. format short e e+03 five digits ( 4 decimals) plus exponent. format long e e-04 sixteen digits (15 decimals) plus exponent. Format bank two decimal digits. MATLAB has several other formats in which numbers can be displayed. DISPLAY FORMATS

WORKING IN THE COMMAND WINDOW The command window opens when MATLAB is started. To type a command the cursor must be placed after the command prompt (>>). Once a command is typed, and the “Enter” key is pressed, the command is executed. (Only the last command is executed. Everything executed before is unchanged) It is not possible to go back to a previous line and make a correction. A previously typed command can be recalled to the command prompt with the up-arrow key.

Using numbers: USING MATLAB AS A CALCULATOR 8/2 is executed first >> 7+8/2 ans = 11 Type and press Enter Computer response 7+8 is executed first >> (7+8)/2 ans = Type and press Enter Computer response 5/3 is executed first >> 4+5/3+2 ans = Type and press Enter Computer response

5^3 is executed first, /2 is executed next. 5^3/2 ans = >> Type and press Enter Computer response 1/3 is executed first, ^ is executed next, + is executed last. >> 27^(1/3)+32^0.2 ans = 5 Type and press Enter Computer response 27^1 and 32^0.2 is executed first, /3 is executed next, + is executed last. >> 27^1/3+32^0.2 ans = 11 Type and press Enter Computer response

MATLAB BUILT-IN MATH FUNCTIONS In addition to arithmetic operations, MATLAB can be used to calculate elementary math functions. The most common ones are: sin(x) x in radians cos(x) x in radians tan(x) x in radians cot(x) x in radians The inverse is: asin(x), acos(x), etc. exp(x) exponential log(x) natural logarithm log10(x) base 10 logarithm sqrt(x) square root abs(x) absolute value Examples: >> sin( ) ans = >> sqrt(169) ans = 13 >> log10(10000) ans = 4 MATLAB has hundreds of built-in functions (this will be discussed in future lectures).

Assignment MATLAB 1