Introduction to Matlab for Engineers

Similar documents
MoLE Gas Laws Activities

UNIVERSITY OF WATERLOO

Table of Contents. 1 Command Summary...1

Using MATLAB with CANoe

WMS 8.4 Tutorial Hydraulics and Floodplain Modeling HY-8 Modeling Wizard Learn how to model a culvert using HY-8 and WMS

MoLE Gas Laws Activities

Sesam HydroD Tutorial

Lab 4: Root Locus Based Control Design

Vapor Pressure of Liquids

PC Configuration software for Discovery MkVI v 1.03 User guide

Welcome to Step Outside with Togo & Nogo a road safety training resource for year 2 children

Microfluidic Demonstration

Virtual Breadboarding. John Vangelov Ford Motor Company

Algebra I: A Fresh Approach. By Christy Walters

Math 4. Unit 1: Conic Sections Lesson 1.1: What Is a Conic Section?

Vapor Pressure of Liquids

How to Set Up Your League

A COURSE OUTLINE (September 2001)

Boyle s Law: Pressure-Volume. Relationship in Gases

Blackwave Dive Table Creator User Guide

EXPERIMENT 12 GAS LAWS ( BOYLE S AND GAY-LUSSAC S LAW)

v2.3 USER MANUAL

AKTA 3D SOP. Click on the System Control tab. This screen has 4 windows.

Two-Dimensional Motion and Vectors

Version 3.1.0: New Features/Improvements: Improved Bluetooth connection on Windows 10

A.J. Simon Chris Edwards

Evaluation copy. Vapor Pressure of Liquids. computer OBJECTIVES MATERIALS

Class VII EXAM TYPE & SUBJECT. English PERIODIC TEST 1 ( ) Bengali PERIODIC TEST 1

Open Source and Traditional Technical Computing

To Logon On to your tee sheet, start by opening your browser. (NOTE: Internet Explorer V. 6.0 or greater is required.)

Algebra I: A Fresh Approach. By Christy Walters

Mac Software Manual for FITstep Pro Version 2

Lab 1. Adiabatic and reversible compression of a gas

ACI_Release_Notes.txt VERSION Fixed Tank info for ELITE in Dive section 2. Fixed USB port initializing for old DC VERSION

Previous Release Notes

Adobe Captivate Monday, February 08, 2016

KEM Scientific, Inc. Instruments for Science from Scientists

SOFTWARE. Sesam user course. 02 May 2016 HydroD Input. Ungraded SAFER, SMARTER, GREENER DNV GL 2016

Quintic Automatic Putting Report

m r [B] mn n> 20r [C] mn n< 8r [D] mn n< 20r

Oxygen Meter User Manual

Gas Pressure and Volume Relationships *

Chapter 12 Practice Test

AKTA ION EXCHANGE CHROMATOGRAPHY SOP Date: 2/02/05 Author: A DeGiovanni Edited by: C. Huang Reviewed by:

Diver Training Options

USER MANUAL April 2016

ISS MMS Artistic Swimming

INSTRUMENT INSTRUMENTAL ERROR (of full scale) INSTRUMENTAL RESOLUTION. Tutorial simulation. Tutorial simulation

It is often said in sports that records are made to be

COMPUTATIONAL OCEAN ACOUSTIC TOOLBOX MANUAL. Computational Ocean Acoustics Toolbox (COAT) is a package written containing the following

Quick Start Guide. For Gold and Silver Editions

Flow Vision I MX Gas Blending Station

Taking Your Class for a Walk, Randomly

CS Problem Solving and Object-Oriented Programming Lab 2 - Methods, Variables and Functions in Alice Due: September 23/24

Boyle s Law: Pressure-Volume Relationship in Gases

Diver-Office. Getting Started Guide. 2007, Schlumberger Water Services

Tutorial 2 Time-Dependent Consolidation. Staging Groundwater Time-dependent consolidation Point query Line query Graph Query

Write Your Own Twine Adventure!

Bioequivalence: Saving money with generic drugs

Boyle s Law: Pressure-Volume Relationship in Gases

ScaleChem Basics. Revised 29 May This material may not be printed without the following acknowledgement page.

AKTA MC SOP Page 1 9/27/04 AKTA METAL CHELATING SOP

MATH 110 Sample 02 Exam 1

Chapter 11 Waves. Waves transport energy without transporting matter. The intensity is the average power per unit area. It is measured in W/m 2.

Section 10 - Hydraulic Analysis

1001ICT Introduction To Programming Lecture Notes

Savannah S100 ALD at SCIF, UC Merced Standard operating Procedure

An Analysis of Graphical Representations of Bowling. Allison Nelson. Summer Ventures Appalachian State University

MV-TRAINER USER MANUAL

Shearwater Cloud Desktop Release Notes

Section Freepoint Service 26.1 FREEPOINT CONTROL PANEL

Boyle s Law: Pressure-Volume Relationship in Gases

Air Ball! Evaluation copy

Robot Activity: Programming the NXT 2.0

Rescue Rover. Robotics Unit Lesson 1. Overview

SCRATCH CHALLENGE #3

Mechatronic System Design (ENT473)

Division Data Coordinator Tasks

ISDS 4141 Sample Data Mining Work. Tool Used: SAS Enterprise Guide

Using Moodle. Poramin Bheganan Krittaya Bunchongchit

Chapter 11 Waves. Waves transport energy without transporting matter. The intensity is the average power per unit area. It is measured in W/m 2.

ORF 201 Computer Methods in Problem Solving. Final Project: Dynamic Programming Optimal Sailing Strategies

Software Manual for FITstep Pro Version 2

GMS 10.0 Tutorial SEAWAT Viscosity and Pressure Effects Examine the Effects of Pressure on Fluid Density with SEAWAT

POM Patch 7. Service Request: OUTREACH-8673: POM help pages are accessed via http instead of https

Diver-Pocket Diver-Pocket Premium

NAUI RGBM Dive Planner Windows Version Rev 9/2016

Dragon Medical Practice Edition Training Workbook Version 4 by Alexandria Carstens of Speakeasy Solutions Inc.

World Ocean Atlas (WOA) Product Documentation

Instruction Manual. BZ7002 Calibration Software BE

Parametric Ball Toss TEACHER NOTES MATH NSPIRED. Math Objectives. Vocabulary. About the Lesson. TI-Nspire Navigator System

1.4 Super Procedures and Sub Procedures

The Beginner's Guide to Mathematica Version 4

Tying Knots. Approximate time: 1-2 days depending on time spent on calculator instructions.

FireHawk M7 Interface Module Software Instructions OPERATION AND INSTRUCTIONS

Math A Regents Exam 0806 Page 1

@GAS USER S MANUAL VERSION 4.0 COPYRIGHT NOTICE

Reading Time: 15 minutes Writing Time: 1 hour 30 minutes. Structure of Book. Number of questions to be answered. Number of modules to be answered

(POM )

Laboratory 2(a): Interfacing WiiMote. Authors: Jeff C. Jensen (National Instruments) Trung N. Tran (National Instruments)

Transcription:

Introduction to Matlab for Engineers Instructor: Anh Thai Nhan Math 111, Ohlone Introduction to Matlab for Engineers Ohlone, Fremont 1/23

Reading materials Chapters 1, 2, and 3, Moore s textbook Introduction to Matlab for Engineers Ohlone, Fremont 2/23

What is Matlab? Matlab (Matrix Laboratory) is a multi-paradigm numerical computing environment and fourth-generation programming language. Originally designed as a tool for matrices, developed by MathWorks. Introduction to Matlab for Engineers Ohlone, Fremont 3/23

Why Matlab? Matlab is very easy to use. Matlab excels at computations involving matrices. We can use Matlab as your scientific calculator. Matlab has a bunch of built-in functions. Matlab excels at graphics, whereas high-level programming languages such as C, C++, or FORTRAN do not offer easy access to graphing. Introduction to Matlab for Engineers Ohlone, Fremont 4/23

Example: 3D graphic (Heat equation) Introduction to Matlab for Engineers Ohlone, Fremont 5/23

Matlab Interface Command Window: where you type commands Workspace: the current variables. Look at the workspace after typing x=[1:5] Current Directory: a list of paths recognized by Matlab Current Folder Toolbar: the file in the active directory Editor Window: where you will do most of your work Introduction to Matlab for Engineers Ohlone, Fremont 6/23

Moving Windows Docking and Undocking Menus allows you to choose what is shown Introduction to Matlab for Engineers Ohlone, Fremont 7/23

Working in the Command Window The Command Window is Good for quick work Good for calling scripts and functions Good for getting help Not editable Not easy to fix mistakes Not for long work Introduction to Matlab for Engineers Ohlone, Fremont 8/23

Getting Help Help Browser from the Desktop Help menu Type doc and the command name Type help and the command name Introduction to Matlab for Engineers Ohlone, Fremont 9/23

Getting Help Introduction to Matlab for Engineers Ohlone, Fremont 10/23

Operations Between Two Scalars Introduction to Matlab for Engineers Ohlone, Fremont 11/23

Special Characters, Separates commands ; Hides the output of a command % Creates a comment statement pi π eps The smallest number understood by Matlab inf Infinity i or j i = 1 NaN Not a number Introduction to Matlab for Engineers Ohlone, Fremont 12/23

Elementary Functions Functions use the format function-name(arguments) sqrt(x) Square root sin(x) Sine in radians sind(x) Sine in degrees atan(x) Arctangent log(x) Natural logarithm (ln x) log10(x) Common logarithm (log 10 x) log2(x) base 2 logarithm (log 2 x) who A list of variables whos A list of variables and sizes why For fun ans The result of last command clear Clear the workspace window clc Clears the command window Introduction to Matlab for Engineers Ohlone, Fremont 13/23

Elementary Functions Introduction to Matlab for Engineers Ohlone, Fremont 14/23

Elementary Functions Introduction to Matlab for Engineers Ohlone, Fremont 15/23

Elementary Functions Introduction to Matlab for Engineers Ohlone, Fremont 16/23

Elementary Functions Introduction to Matlab for Engineers Ohlone, Fremont 17/23

Elementary Functions Introduction to Matlab for Engineers Ohlone, Fremont 18/23

Numeric Output format short format short e format long format rat format bank Four places after the decimal Scientific with 4 places after the decimal Fifteen places after the decimal Rational Dollars and cents To see the effects, create x=[1,pi,1/4,1/7], change the type using one of the format commands, and type x. Repeat for y=[1,2,3,4] Repeat for y+1. What is happening? Look up format in the Help files for more options Introduction to Matlab for Engineers Ohlone, Fremont 19/23

Numeric Output Table 2.2, Moore s textbook, page 41 Introduction to Matlab for Engineers Ohlone, Fremont 20/23

Table 2.2, Moore s textbook, page 41 Numeric Output Introduction to Matlab for Engineers Ohlone, Fremont 21/23

Scripts A script a text file that contains all of the commands to be entered in sequence. It is very important to know how to write and edit your code on a script! Editable Easy to fix mistakes Used for long work Easily saved and sent to others Two types: scripts and functions With scripts, variables are global With functions, variables are local Introduction to Matlab for Engineers Ohlone, Fremont 22/23

Scripts I will show you how to: Open a new script Save a script with a proper name Run a script Introduction to Matlab for Engineers Ohlone, Fremont 23/23