Engineering Analysis – Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.

Slides:



Advertisements
Similar presentations
Fall 2006AE6382 Design Computing1 Numeric Representation in a Computer Learning Objectives Understand how numbers are stored in a computer and how the.
Advertisements

General Computer Science for Engineers CISC 106 Lecture 21 Dr. John Cavazos Computer and Information Sciences 04/10/2009.
Introduction to MATLAB
EGR 106 – Week 2 – Arrays Definition, size, and terminology Construction methods Addressing and sub-arrays Some useful functions for arrays Character arrays.
Introduction to MATLAB Week 13 – 4/21/09. Instructor: Kate Musgrave Time: Tuesdays 3-5pm Office Hours: Tuesdays 1:30-3pm
EGR 106 – Week 2 – Arrays & Scripts Brief review of last week Arrays: – Concept – Construction – Addressing Scripts and the editor Audio arrays Textbook.
Introduction to MATLAB 7 for Engineers
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.
Digital Image Processing Lecture3: Introduction to MATLAB.
Programming For Nuclear Engineers Lecture 12 MATLAB (3) 1.
MATLAB Fundamentals.
1 MATLAB 基礎. 2 MATLAB  Workspace: environment (address space) where all variables reside  After carrying out a calculation, MATLAB assigns the result.
January 24, 2005 Lecture 3 - By P. Lin 1 CPET 190 Lecture 3 Problem Solving with MATLAB
Lecture 1: Introduction Lecture series based on the text: Essential MATLAB for Engineers and Scientists By Hahn & Valentine
M-files While commands can be entered directly to the command window, MATLAB also allows you to put commands in text files called M- files. M-files are.
MATLAB INTRO CONTROL LAB1  The Environment  The command prompt Getting Help : e.g help sin, lookfor cos Variables Vectors, Matrices, and Linear Algebra.
BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
THE MATLAB ENVIRONMENT VARIABLES BASIC COMMANDS HELP HP 100 – MATLAB Wednesday, 8/27/2014
Introduction to MATLAB Session 1 Prepared By: Dina El Kholy Ahmed Dalal Statistics Course – Biomedical Department -year 3.
Introduction to MATLAB January 18, 2008 Steve Gu Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB,
1 Chapter 1 MATLAB Primer This introductory chapter is relatively short and has as its main objective the introduction of MATLAB ® to the reader. This.
Math 15 Lecture 7 University of California, Merced Scilab A “Very” Short Introduction.
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.
Introduction to Engineering MATLAB – 6 Script Files - 1 Agenda Script files.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
Copyright © The McGraw-Hill Companies, Inc. Introduction to MATLAB for Engineers, Third Edition William J. Palm III Chapter 1 An Overview of MATLAB.
Chapter 2: First Steps in MuPAD MATLAB for Scientist and Engineers Using Symbolic Toolbox.
Chapter 1: Getting Started with MATLAB MATLAB for Scientist and Engineers Using Symbolic Toolbox.
A Brief introduction to MatLAB ($50 - $99 for students)
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
26 - 3/20/2000AME 150L1 M ATLAB ® /20/2000AME 150L2 M ATLAB ® vs. Fortran Fortran Positives –First Compiler –Legacy Codes –Efficient Numerically.
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.
Script M-Files Group of Matlab commands placed in a text file with a text editor. Matlab can open and execute the commands exactly as if they were entered.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
ES 240: Scientific and Engineering Computation. Chapter 2 Chapter 2: MATLAB Fundamentals Uchechukwu Ofoegbu Temple University.
What is Matlab Course Goals Precedence Accounts & Login Variables Error Types Course Logistics Vince Bertsch Office:
Chapter 1 – Matlab Overview EGR1302. Desktop Command window Current Directory window Command History window Tabs to toggle between Current Directory &
Introduction to MATLAB 7 MATLAB Programming for Engineer Hassan Migdadi Spring 2013.
1 CS1371 Introduction to Computing for Engineers Introduction to Matlab.
1 Lecture 1 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Part 1 Chapter 2 MATLAB Fundamentals PowerPoints organized by Dr. Michael R. Gustafson II, Duke University and Prof. Steve Chapra, Tufts University All.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
Interduction to MATLAB Manal Alotaibi Mathematics department College of science King saud university.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
ENG 1181 First-Year Engineering Program College of Engineering Engineering Education Innovation Center First-Year Engineering Program MAT - Introduction.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started.
1 Faculty Name Prof. A. A. Saati. 2 MATLAB Fundamentals 3 1.Reading home works ( Applied Numerical Methods )  CHAPTER 2: MATLAB Fundamentals (p.24)
Introduction to Programming on MATLAB Ecological Modeling Course Sep 11th, 2006.
BASICS OF MATLAB Engr.Mian Shahzad Iqbal Lecturer,Telecom Department University of Engineering & Technology Taxila.
An Introduction to Programming in Matlab Emily Blumenthal
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
Basic operations in Matlab
Engineering Analysis – Fall 2009
MATLAB DENC 2533 ECADD LAB 9.
Lecture 1: Introduction
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
Experiment No. (1) - an introduction to MATLAB
Using Script Files and Managing Data
Introduction to Matlab
Presentation transcript:

Engineering Analysis – Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00

Lecture 2 2 Lecture 3 Last time - Analytical and Numerical Methods for Model Solving Today: - Overview of Matlab - Laplace Transform - Solving differential equations using the Laplace Transform - Example Next Time - Arrays in Matlab - Graphics - Number representation and roundoff errors

Lecture 2 3 Matlab The workspace  The environment (address space) where all variables reside. After carrying out a calculation, MATLAB assigns the result to the built-in variable called ans; A “%” character marks the beginning of a comment line. Three windows: Command window – used to enter commands and data Edit window - used to create and edit M-files (programs) such as the factor. For example, we can use the editor to create factor.m Graphics window(s) - used to display plots and graphics

Lecture 2 4 Command window Used to enter commands and data. The prompt is “>>” ; Allows the use of Matlab as a calculator when commands are typed in line by line, e.g., >> a = ans = 61 >> b = a * 10 ans =610

Lecture 2 5 System commands who/whos  list all variables in the workspace clear  removes all variables from the workspace computer  lists the system MATLAB is running on version  lists the toolboxes (utilities) available

Variables Scalar and arrays; numerical data and text. You do not need to pre-initialize a variable; if it does not exist, MATLAB will create it for you.

Lecture 2 7 Variable names Variable names  up to 31 alphanumeric characters (letters, numbers) and the underscore (_) symbol; must start with a letter. Reserved names for variables and constants. ans - Most recent answer. eps - Floating point relative accuracy. realmax - Largest positive floating point number. realmin - Smallest positive floating point number. pi i - Imaginary unit. j - Imaginary unit. inf - Infinity. nan - Not-a-Number. isnan - True for Not-a-Number. isinf - True for infinite elements. isfinite - True for finite elements. why - Succinct answer.

Lecture 2 8 Variable names (cont’d) To report the value of variable kiki type its name: >> kiki kiki = 13 To prevent the system from reporting the value of variable kiki append the semi-solon (;) at the end of a line: >> kiki = 13;

Data display The format command allows you to display real numbers short - scaled fixed-point format with 5 digits long - scaled fixed-point format with 15 digits for double and 7 digits for single short eng - engineering format with at least 5 digits and a power that is a multiple of 3 (useful for SI prefixes) The format does not affect the way data is stored internally

Format Examples >> format short; pi ans = >> format long; pi ans = >> format short eng; pi ans = e+000 >> pi*10000 ans = e+003 Note - the format remains the same unless another format command is issued.

Lecture 2 11 Script file - set of MATLAB commands Example: the script factor.m: function fact = factor(n) x=1; for i=1:n x=x*i; end fact=x; %fprintf('Factor %6.3f %6.3f \n' n, fact); end Scripts can be executed by: (i) typing their name (without the.m) in the command window; (ii) selecting the Debug, Run (or Save and Run) command in the editing window; or (iii) hitting the F5 key while in the editing window. Option (i) will run the file as it exists on the drive, options (ii) and (iii) save any edits to the file. Example: >> factor(12) ans =

Lecture 2 12 Transform Methods Basic idea: find a convenient representation of the equations describing a physical phenomena. For example, in signal analysis rather than analyzing a function of time, s(t), study the spectrum of the signal S(f), in other words carry out the analysis in the frequency domain rather than the time domain. Advantage of Fourier (spectral analysis): More intuitive physical representation Instead of correlation (an intensive numerically problem) use multiplication.

Lecture 2 13 Properties of the Laplace Transform Linearity Scaling Frequency shifting Time shifting Frequency differentiation Frequency integration Differentiation Integration Convolution

Lecture 2 14