Chapter 1 – Matlab Overview EGR1302. Desktop Command window Current Directory window Command History window Tabs to toggle between Current Directory &

Slides:



Advertisements
Similar presentations
 Microsoft Excel is an electronic spreadsheet.  As with a paper spreadsheet, you can use Excel to organize your data into rows and columns and to perform.
Advertisements

Tutorial 8: Developing an Excel Application
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Chapter 8 and 9 Review: Logical Functions and Control Structures Introduction to MATLAB 7 Engineering 161.
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.
EGR 106 – Week 2 – Arrays & Scripts Brief review of last week Arrays: – Concept – Construction – Addressing Scripts and the editor Audio arrays Textbook.
General Computer Science for Engineers CISC 106 Lecture 08 Dr. John Cavazos Computer and Information Sciences 2/27/2009.
Introduction to MATLAB 7 for Engineers
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 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.
What is MATLAB ? MATrix LABratory –Originally, it was a front-end to FORTRAN matrix routines developed in the U. of New Mexico and Stanford –Today.
INTRO TO PROGRAMMING Chapter 2. M-files While commands can be entered directly to the command window, MATLAB also allows you to put commands in text files.
Lesson 1 – Microsoft Excel The goal of this lesson is for students to successfully explore and describe the Excel window and to create a new worksheet.
MATLAB File Management. MATLAB User File Management Matlab provides a group of commands to manage user files. For more information, type help iofun. pwd.
Introduction to MATLAB January 18, 2008 Steve Gu Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB,
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.
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
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.
Copyright © The McGraw-Hill Companies, Inc. Introduction to MATLAB for Engineers, Third Edition William J. Palm III Chapter 1 An Overview of MATLAB.
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)
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
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.
Excel Lesson 1 Excel Basics
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 DKT 211 Basic Communication Engineering LAB # 1A : (Lecture 1) Introduction to Matlab  Basic Features  Scientific features  Array Operations  Script.
Getting Started with MATLAB (part2) 1. Basic Data manipulation 2. Basic Data Understanding 1. The Binary System 2. The ASCII Table 3. Creating Good Variables.
Chapter 6 Review: User Defined Functions Introduction to MATLAB 7 Engineering 161.
Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz SUNY-New Paltz “Lecture 2”
>> x = [ ]; y = 2*x y = Arrays x and y are one dimensional arrays called vectors. In MATLAB all variables are arrays. They allow functions.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Lesson 1 - Understanding the Word Window and Creating a New Document
INTRODUCTION TO MATLAB Dr. Hugh Blanton ENTC 4347.
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
Introduction to Engineering MATLAB – 4 Arrays Agenda Creating arrays of numbers  Vectors: 1-D Arrays  Arrays: 2-D Arrays Array Addressing Strings & String.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started.
Extending MATLAB Write your own scripts and/or functions Scripts and functions are plain text files with extension.m (m-files) To execute commands contained.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
CS100A, Fall 1998, Lecture 201 CS100A, Fall 1998 Lecture 20, Tuesday Nov 10 More Matlab Concepts: plotting (cont.) 2-D arrays Control structures: while,
Structured Computer Programming EE 201 Introduction to MATLAB 7 for Engineers بسم الله الرحمن الرحيم King Abdulaziz University College of Engineering Dept.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
Pasewark & Pasewark 1 Excel Lesson 1 Excel Basics Microsoft Office 2007: Introductory.
Key Applications Module Lesson 12 — Word Essentials Computer Literacy BASICS.
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
Introduction to MATLAB for Engineers, Third Edition
Basic operations in Matlab
MATLAB DENC 2533 ECADD LAB 9.
WEB PROGRAMMING JavaScript.
Use of Mathematics using Technology (Maltlab)
Digital Image Processing
An Introduction to Computers and Visual Basic
INTRODUCTION TO MATLAB
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
Experiment No. (1) - an introduction to MATLAB
Presentation transcript:

Chapter 1 – Matlab Overview EGR1302

Desktop Command window Current Directory window Command History window Tabs to toggle between Current Directory & Workspace Windows

Desktop Default appearance Command window Communicates with MATLAB program Type commands Receive response to your commands Displays “>>” prompt MATLAB is ready to receive instructions User types command, presses “Enter” to execute “;” at end of command suppresses response Retains previous keystrokes Use “ ↑” key to scroll backward Use “↓” key to scroll forward Edit with “←”, “→”, “Backspace”, “Delete”

Desktop Default appearance Command History window Shows all previous keystrokes Copies previous command to Command window Left-click and drag to Command window Double-click to re-execute command

Desktop Default appearance Current Directory window Serves as file manager window Double-click on.m file to open Editor window Workspace window Lists variables created in Command window Double-click on variable name to open Array Editor window

Desktop Default appearance Row of menu names Each window type has its own menu bar Toolbar Shortcut buttons Current directory box Change to directory in which you save your files Provides path for Current Directory window

Variables A symbol used to contain a value Used to write mathematical expressions Variable naming convention Must begin with a letter Must contain < 32 characters Is case sensitive May contain letters, digits, & underscore Scalar variable - a single number Array variable - a collection of numbers Can be handled by MATLAB as a single variable

Variables Assigning values to variables Use “=“ as assignment operator Variable name on left-hand side is replaced by value generated by right-hand side Right-hand side must have computable value Array assignment “[]” contains numbers being assigned Commas separate elements in row Semi-colons separate rows

Variables Array assignment (cont) Special format for assigning row array with regularly spaced numbers Type first number, last number, with spacing in middle All numbers separated by colon “:”

Variables Array addressing Use just variable name in expressions Operation is performed on every element in the array IF matrix operation is “legal” Use variable name & array index in expressions Point to a particular element in the array Use if operation to be performed is not “legal” matrix operation

Variables MATLAB has predefined variables Avoid using names of predefined variables as variable names

Mathematical Expressions Order of precedence Highest order of precedence first Operators of equal precedence from left to right

Functions MATLAB mathematical functions Pair of parentheses after function name encloses function’s argument Can be part of mathematical expression

Functions Users can define functions MATLAB commands and functions for managing the work session

Plotting Graphics window Appears in Desktop when a plot is generated

Plotting Simple rectilinear plot Function plot(x,y) Generates a plot with x-values on the horizontal axis and y-values on the vertical axis Function xlabel(‘xxxx’) Places text within single quotes as label for horizontal axis Function ylabel(‘yyyy’) Places text within single quotes as label for vertical axis

Plotting Simple rectilinear plot (cont) Function title(‘text’) Places text at top of plot Overlay plots Include another set or sets of values in plot function

Script Files Program files saved with.m extension Use Editor window

Script Files Naming convention Same as for naming variables Not the same name as a variable or a MATLAB function Use exist(‘name’) function to verify that a prospective filename is not already in use

Script Files Comments “%” - Not executed by MATLAB Comments section – at beginning of program 1 st line - name of the program, keywords 2 nd line - date created and programmer’s name 3 rd line – description of program’s purpose Variable definitions Input Output Internal to program

Script Files Comments Additional comments throughout program Break program into sections. Describe purpose for calculations Programming in MATLAB Relational operators Used to make comparisons

Script Files Programming in MATLAB (cont) Conditional statements Allow decision-making if expression commands elseif expression commands else commands end

Script Files Programming in MATLAB (cont) Loops Repeated calculations For  Number of passes is known ahead of time While  Looping terminates when a condition is met for k=1:10 commands end while condition commands end