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.

Slides:



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

Introduction to MATLAB The language of Technical Computing.
Introduction to Matlab Workshop Matthew Johnson, Economics October 17, /13/20151.
 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
Engineering Computation using MATLAB
 Statistics package  Graphics package  Programming language  Can be used to share/reproduce analyses  Many new packages being created - can be downloaded.
Boardmaker 6 Basic Tutorial
Introduction to MATLAB 3 November Instructor: Andy Newman Office Hours: Stop by room 306 (main building) whenever
EGR 106 – Week 2 – Arrays & Scripts Brief review of last week Arrays: – Concept – Construction – Addressing Scripts and the editor Audio arrays Textbook.
ES 100: Introduction to Engineering Use of the Computer 1.Log in using your Novell password. If you do not know your password, immediately (now!) see Al.
Introduction to MATLAB Northeastern University: College of Computer and Information Science Co-op Preparation University (CPU) 10/22/2003.
Division Example 2x - 3y + 4z = 10 x + 6y - 3z = 4 -5x + y + 2z = 3 A*X = B where A = B = >> X = A\B X =
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 R Statistical Software Anthony (Tony) R. Olsen USEPA ORD NHEERL Western Ecology Division Corvallis, OR (541)
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.
Programming For Nuclear Engineers Lecture 12 MATLAB (3) 1.
Lecture 1: Introduction Lecture series based on the text: Essential MATLAB for Engineers and Scientists By Hahn & Valentine
BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.
Introduction to M ATLAB EE 100 – EE Dept. - JUST.
Lecture 4 MATLAB Windows Arithmetic Operators Maintenance Functions
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
1 Lab of COMP 406 Teaching Assistant: Pei-Yuan Zhou Contact: Lab 1: 12 Sep., 2014 Introduction of Matlab (I)
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
Release Numbers MATLAB is updated regularly The Mathworks packages their software in groups, called releases, New releases are issued twice a year in the.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
Matlab for Engineers About Matlab Chapter 1. Matlab for Engineers What’s in this Chapter? What is Matlab? Student Edition of Matlab How is Matlab used.
About MATLAB® Chapter 1 Welcome to Chapter 1 of MATLAB for Engineers. In this chapter we’ll introduce you to the MATLAB computer software program.
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.
A Brief introduction to MatLAB ($50 - $99 for students)
Introduction to MATLAB 7 Engineering 161 Engineering Practices II Joe Mixsell Spring 2010.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
CMPS 1371 Introduction to Computing for Engineers MatLab.
10/24/20151 Chapter 2 Review: MATLAB Environment Introduction to MATLAB 7 Engineering 161.
Basic Computer and Word Functions, part 1 Read the information and use to answer the questions in the Basic Computer and Word Functions Study Guide.
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 Three The UNIX Editors.
Introduction to MATLAB 7 MATLAB Programming for Engineer Hassan Migdadi Spring 2013.
Fall 2003Sylnovie Merchant, Ph.D. ACCESS Tutorial Note: The purpose of this tutorial is to provide an introduction to some of the functions of ACCESS in.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
Introduction to MATLAB 7 Engineering 161 Engineering Practices II Joe Mixsell Spring 2012.
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.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Illustrator lecture 1: how to use Adobe Illustrator with raster maps? Yhd Water and people.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
Physics 114: Lecture 1 Overview of Class Intro to MATLAB
Release Numbers MATLAB is updated regularly
Lecture 25.
Guide To UNIX Using Linux Third Edition
Outline Matlab tutorial How to start and exit Matlab Matlab basics.
INTRODUCTION TO BASIC MATLAB
MATLAB DENC 2533 ECADD LAB 9.
Matlab Workshop 9/22/2018.
User Defined Functions
Lecture 1: Introduction
Use of Mathematics using Technology (Maltlab)
Digital Image Processing
Introduction to MATLAB
CSCI N317 Computation for Scientific Applications Unit 1 – 1 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.
Chapter 2 MATLAB Environment
Presentation transcript:

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 window

What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation tools Others include Maple Mathematica MathCad

MATLAB is both a powerful computational environment and a programming language that easily handles matrix and complex arithmetic. It is a large software package that has many advanced features built in, and it has become a standard tool for many working in science or engineering disciplines. Among other things, it allows easy plotting in both two and three dimensions. What Is MATLAB?

MATLAB is good at: Numerical calculations – Especially:matrices Graphics MATLAB stands for Mat rix Lab oratory

Why MATLAB Easy to use Built in programming language MATLAB was originally written in Fortran, then later rewritten in C

Release Numbers MATLAB is updated regularly The Mathworks packages their software in groups, called releases, New releases are issued twice a year in the spring and in the fall Release 2013a includes – MATLAB 8.1 – A number of specialized “toolboxes”

MATLAB in Industry Widespread, Tool of choice in Academia for most engineering and science fields MATLAB is also being used in the medical field. These images were created from MRI data, using MATLAB.

MATLAB has two different methods for executing commands: interactive mode and batch mode. In interactive mode, commands are typed (or cut and pasted) into the command window. In batch mode, a series of commands is saved in a text file with a.m extension. The batch commands in a file are then executed by typing the name of the file at the MATLAB command prompt. What Is MATLAB?

MATLAB is an interpreted language. Commands are executed line by line. It supports two basic types: characters like 'a' (16 bits) and doubles like 8.25 (64 bits). Most of the time MATLAB works with arrays or matrices of real numbers or characters. Other types are also supported: complex, symbolic (if installed), 16-bit and 8-bit integers, etc... The MATLAB Language

Problem Solving A standardized approach to problem solving commonly found in all science disciplines. 1.first you state the problem, 2.then describe the input and output. 3. Develop a plan for solving the problem, called an algorithm. 4.Then you actually solve the problem, in our case using MATLAB, and 5. finally you test your solution for reasonableness. If you use a consistent problem solving strategy you increase the chance that your result is correct

MATLAB

MATLAB uses a standard windows menu bar To exit MATLAB use the close icon

Command Window Enter commands at the prompt MATLAB Windows Command History Window Records all commands issued in the command window – including mistakes Current Folder Window Lists files stored in the current directory Workspace Window

The MATLAB Desktop Current Folder Window Command Window Workspace Window Command History Window

Let’s look at the windows one at a time

At the prompt (>>), type in a MATLAB command. Press the ENTER key. MATLAB displays the result in the command window, followed by a prompt. Repeat the process. The Command Window

To start a command, make sure cursor is next to the prompt. MATLAB won’t respond until you press ENTER. It then executes only the last command. Commands before the last one may still be visible, but MATLAB doesn’t execute them. Notes on the Command Window

You can type several commands in the same line by putting a comma between commands. (makes the program harder to read though, so it is not recommended). If a command is too long to fit on one line, you can continue to the next line by typing ellipsis (3 periods, i.e., … ) and then pressing ENTER. Notes on the Command Window

When cursor is in the bottom (current) command line:   key moves the cursor one character to the left.  key moves the cursor one character to the right.  key recalls the preceding command  key recalls a previous command if it follows. Navigating the Command Window

Command Window Similar to a scratch pad Once you hit enter, you can’t edit any commands You can retype them or use the arrow keys to retrieve commands and edit them before hitting enter again Command Window

The PAGE-UP key moves up to previous commands in a window-size at a time. The PAGE-DOWN key moves down to previous commands in a window-size at a time. The BACKSPACE (Delete on Mac) key deletes one character to the left of the cursor. The DELETE (fn-Delete on Mac) key deletes one character to the right of the cursor. Navigating the Command Window

To quickly execute a previous command but with small changes: Recall the command with the up and down arrow keys. Use the left and right arrow keys to move to characters to be altered. Use BACKSPACE (Mac: Delete) or DELETE (Mac: fn-Delete) to remove old characters, then type new characters. Press ENTER to execute the modified command. T I P

Semicolon (;) When typed at end of a command, it suppresses the output. (only the prompt is displayed at the next line) Useful for preventing display of large outputs Used much more in scripts (see Section 1.8 of text book) Percent sign (%) When typed at beginning of a line, MATLAB treats the line as a comment and doesn’t execute the line. Also used much more in scripts. Command Syntax

Clears the command window display. The up and down arrows still bring back the previous commands. The clc Command

Shows the previous commands, including the ones from previous MATLAB sessions. Double-clicking on a command puts it in the command window and executes it. You can drag a command to the command window, make changes in it, then execute it. The Command History Window

Command History Records the commands you issue in the command window When you exit the command window, or when you issue the clc command, the command window is cleared But the command history remains Command History

You can transfer commands from the command history to the command window – Double click on a command It executes immediately – Click and drag into the command window You can edit the command before executing

Workspace Window

NOTE! When you define variables in the command window, they are listed in the workspace window Document Window: If you double click on any variable in the workspace window MATLAB launches a document window containing the array editor You can edit variables in the array editor Figure Window: When Figures are created a new window opens It’s extremely easy to create graphs in MATLAB

The Figure Window The Figure Window opens automatically after any command that draws a graph. Figure Window

Scalar Vector 2-D Matrix

Current Directory/Folder The current folder window is a list of files When you try to load information from a file or try to save information – MATLAB uses the current folder

The Document Window displays the variable editor New Variable Icon

Note: The semicolon suppresses the output from each command First create a vector of x values – then a corresponding vector of y values

Matlab makes it easy to modify graphs by adding Titles Axis labels Legends Other types of annotations