BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.

Slides:



Advertisements
Similar presentations
Introduction to Programming using Matlab Session 2 P DuffourJan 2008.
Advertisements

BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.
Introduction to Matlab. I use Matlab for: Data analysis Data plotting Image Analysis Also – Simulations (solving odes/pdes/finite element methods) – Minimisations,
Introduction to MATLAB 7 for Engineers
Introduction to MATLAB
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.
Introduction to programming in MATLAB MATLAB can be thought of as an super-powerful graphing calculator Remember the TI-83 from calculus? With many more.
Digital Image Processing Lecture3: Introduction to MATLAB.
1 MATLAB 基礎. 2 MATLAB  Workspace: environment (address space) where all variables reside  After carrying out a calculation, MATLAB assigns the result.
Lecture 1: Introduction Lecture series based on the text: Essential MATLAB for Engineers and Scientists By Hahn & Valentine
MATLAB INTRO CONTROL LAB1  The Environment  The command prompt Getting Help : e.g help sin, lookfor cos Variables Vectors, Matrices, and Linear Algebra.
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.
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
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.
Introduction to Engineering MATLAB – 1 Introduction to MATLAB Agenda Introduction Arithmetic Operations MATLAB Windows Command Window Defining Variables.
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.
BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.
Chapter 1: Getting Started with MATLAB MATLAB for Scientist and Engineers Using Symbolic Toolbox.
What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation tools. Others include Maple Mathematica MathCad.
1 MatLab Basics Jae Hoon Kim Department of Physics Kangwon National University It contains hundreds of commands to do mathematics. Graph functions, solve.
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.
MATLAB Environment ELEC 206 Computer Applications for Electrical Engineers Dr. Ron Hayne.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 1 – Matlab Overview EGR1302. Desktop Command window Current Directory window Command History window Tabs to toggle between Current Directory &
1 DKT 211 Basic Communication Engineering LAB # 1A : (Lecture 1) Introduction to Matlab  Basic Features  Scientific features  Array Operations  Script.
Chapter 6 Review: User Defined Functions Introduction to MATLAB 7 Engineering 161.
Engineering Analysis – Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
1 Lecture 1 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
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.
Introduction to MATLAB Section2, statistics course Third year biomedical dept. Dina El Kholy, Ahmed Dalal.
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.
Introduction to Matlab Patrice Koehl Department of Biological Sciences National University of Singapore
Matlab for Engineers Matlab Environment Chapter 2.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started.
Interduction to MATLAB (part 2) Manal Alotaibi Mathematics department College of science King saud university.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
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.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
전자장 1 실험 - Matlab 사용법 - Photonic Systems Laboratory School of EE, Seoul National University Photonic Systems Lab School of EECS, S.N.U.
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.
MATLAB The name of MATLAB stands for matrix laboratory. Starting a MATLAB Session -On Microsoft® Windows® platforms, start the MATLAB program by double-clicking.
ECE 1304 Introduction to Electrical and Computer Engineering
Release Numbers MATLAB is updated regularly
Introduction to Matlab
Lecture: MATLAB Chapter 1 Introduction
MATLAB Basics Nafees Ahmed Asstt. Professor, EE Deptt DIT, DehraDun.
INTRODUCTION TO BASIC MATLAB
MATLAB DENC 2533 ECADD LAB 9.
Lecture 1: Introduction
MATLAB – What Is It ? Name is from matrix laboratory Powerful tool for
MATLAB – What Is It ? Name is from matrix laboratory Powerful tool for
Digital Image Processing
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
Introduction to Matlab
Presentation transcript:

BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists

Ch.1: Introduction The objectives of this chapter are to enable you to use some simple MATLAB commands from the Command Window and to examine various MATLAB desktop and editing features. The name MATLAB stands for MATrix LABoratory. because the system was designed to make matrix computations particularly easy.

Cont. There are two essential requirements for successful MATLAB programming: - 1- You need to learn the exact rules for writing MATLAB statements You need to develop a logical plan of attack for solving particular problems. This chapter is devoted mainly with an introduction to the first requirement.

1.1: Using MATLAB

Cont. Some Examples of Matlab Commands: >> 3-2 >> 2*3 >> 1/2 >> 2ˆ3 >> 2\1 >> 2.* 3 >> 1./ 2 >> 2.ˆ 3

Cont. How do you think MATLAB would handle 0/1 and 1/0 ? It gives you the answer “0” and “Inf.”. E.g. 13+Inf,29/inf. etc. What is NaN? It stands for Not-a-Number. It is the answer to calculations like 0/0.

Cont. Assign values to variables: >> a = 2 >> a = a * 10 >> b = 3; >> x = 2; y = 3; >> z = x + y

Cont. MATLAB has all of the usual mathematical functions. Examples: pi, sqrt(), sin(), etc. The exponential function e x is computed in MATLAB as exp(x). >> pi = 4?

Cont. >> u = 5 %u is called a scalar. >> x= 0 : 10 % x is called a vector(row vector). >> size(x), size(u) Other vectors can now be defined (or created) in terms of the vector x just defined. >> y = 2.* x >> w = y./ x

Cont. Drawing a graph of sin(): >> x = 0 : 0.1 : 10; >> z = sin(x); >> plot(x,z), grid

1.3.2 Saving a program: script files File -> New -> M-file / Script Write a program -> save it -> (program_name.m). A MATLAB program saved from the Editor with the extension.m is called a script file, or simply a script. If you enter the program name at the command-line prompt, MATLAB carries out each statement in the script file as if it were entered at the prompt. A script file may be listed in the Command Window with the command “type”. e.g. >> type program_name.

Cont. Ch.1 Important Notes: You can select (and edit) previous commands you have entered using Up-arrow and Down-arrow. MATLAB has a useful editing feature called smart recall. Just type the first few characters of the command you want to recall, e.g. type the characters 2* and press the Up-arrow key—this recalls the most recent command starting with 2*.

2.1.3 The workspace The command “who” lists the names of all the variables in your workspace. The command “whos” lists the size of each variable. The function “ans” returns the value of the last expression evaluated but not assigned to a variable. The Workspace Browser in the desktop provides a handy visual representation of the workspace. You can view and even change the values of workspace variables with the Array Editor.

2.1.3 The workspace All the variables you create during a session remain in the workspace until you clear them. You can clear all the variables by using the command line “clear”. A particular variable can be removed from the workspace, e.g. clear x. More than one variable can also be cleared, e.g. clear x y.

cont. “clc” (for clear command window ). “sin(pi/2)” is a function take the value of pi/2 Notice the difference between a function and a command in Matlab The line with the prompt (>>) is called the command line.

cont. You can quit MATLAB at any time with one of the following: - Select Exit MATLAB from the desktop File menu. - Enter quit or exit at the Command Window prompt. Do not click on the close box in the top right corner of the MATLAB desktop. This does not allow MATLAB to terminate properly and, on rare occasions, may cause problems with your computer operating software.