Desktop Command window

Similar documents
Introduction to. The Help System. Variable and Memory Management. Matrices Generation. Interactive Calculations. Vectors and Matrices

Appendix A. Introduction to MATLAB. A.1 What Is MATLAB?

MATLAB Introduction to MATLAB Programming

MATLAB BASICS. < Any system: Enter quit at Matlab prompt < PC/Windows: Close command window < To interrupt execution: Enter Ctrl-c.

MATLAB Basics. Configure a MATLAB Package 6/7/2017. Stanley Liang, PhD York University. Get a MATLAB Student License on Matworks

Introduction to MATLAB

Matlab Introduction. Scalar Variables and Arithmetic Operators

Introduction to Matlab. By: Dr. Maher O. EL-Ghossain

Matlab notes Matlab is a matrix-based, high-performance language for technical computing It integrates computation, visualisation and programming usin

Chapter 1: An Overview of MATLAB

EGR 111 Introduction to MATLAB

2.0 MATLAB Fundamentals

Introduction to MATLAB

MAT 275 Laboratory 1 Introduction to MATLAB

Introduction to MATLAB

A Brief Introduction to MATLAB

ECE Lesson Plan - Class 1 Fall, 2001

MATLAB Tutorial. Primary Author: Shoumik Chatterjee Secondary Author: Dr. Chuan Li

Getting started with MATLAB

Creates a 1 X 1 matrix (scalar) with a value of 1 in the column 1, row 1 position and prints the matrix aaa in the command window.

Introduction to MATLAB Programming. Chapter 3. Linguaggio Programmazione Matlab-Simulink (2017/2018)

ME 1020 Engineering Programming with MATLAB. Chapter 1 In-Class Assignment: 1.1, 1.3, 1.13, Topics Covered:

Introduction to MATLAB

Grace days can not be used for this assignment

ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah)

Matlab Tutorial. Get familiar with MATLAB by using tutorials and demos found in MATLAB. You can click Start MATLAB Demos to start the help screen.

Digital Image Analysis and Processing CPE

Computer Programming ECIV 2303 Chapter 1 Starting with MATLAB Instructor: Dr. Talal Skaik Islamic University of Gaza Faculty of Engineering

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing

Introduction to MATLAB LAB 1

What is Matlab? A software environment for interactive numerical computations

Outline. CSE 1570 Interacting with MATLAB. Outline. Starting MATLAB. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An.

Matlab Tutorial: Basics

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

Laboratory 1 Octave Tutorial

Introduction to Octave/Matlab. Deployment of Telecommunication Infrastructures

Introduction to MATLAB

Chapter 3: Programming with MATLAB

Introduction to MATLAB

How to learn MATLAB? Some predefined variables

INTRODUCTION TO NUMERICAL ANALYSIS

Introduction to MATLAB programming: Fundamentals

MATLAB Tutorial EE351M DSP. Created: Thursday Jan 25, 2007 Rayyan Jaber. Modified by: Kitaek Bae. Outline

Lecturer: Keyvan Dehmamy

Mathworks (company that releases Matlab ) documentation website is:

Matlab Tutorial 1: Working with variables, arrays, and plotting

Introduction to MATLAB

Using an ICPSR set-up file to create a SAS dataset

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Experiment 1: Introduction to MATLAB I. Introduction. 1.1 Objectives and Expectations: 1.2 What is MATLAB?

MATLAB Introduction To Engineering for ECE Topics Covered: 1. Creating Script Files (.m files) 2. Using the Real Time Debugger

Outline. CSE 1570 Interacting with MATLAB. Starting MATLAB. Outline. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An.

Introduction to MATLAB. Simon O Keefe Non-Standard Computation Group

MATLAB: The Basics. Dmitry Adamskiy 9 November 2011

MATLAB Tutorial. Digital Signal Processing. Course Details. Topics. MATLAB Environment. Introduction. Digital Signal Processing (DSP)

MATLAB. Devon Cormack and James Staley

Some elements for Matlab programming

ME 121 MATLAB Lesson 01 Introduction to MATLAB

This appendix provides a quick start introduction to MATLAB. You should be

MATLAB/Octave Tutorial

INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX

MATLAB Premier. Middle East Technical University Department of Mechanical Engineering ME 304 1/50

Essentials for the TI-83+

EE 301 Signals & Systems I MATLAB Tutorial with Questions

MATLAB - Lecture # 4

The Mathcad Workspace 7

Chapter 4: Programming with MATLAB

PART 1 PROGRAMMING WITH MATHLAB

MATLAB The first steps. Edited by Péter Vass

Short Introduction into MATLAB

STAT/MATH 395 A - PROBABILITY II UW Winter Quarter Matlab Tutorial

A Very Brief Introduction to Matlab

LabVIEW MathScript Quick Reference

MATLAB Programming for Numerical Computation Dr. Niket Kaisare Department Of Chemical Engineering Indian Institute of Technology, Madras

To start using Matlab, you only need be concerned with the command window for now.

Introduction to Matlab

University of Alberta

Chapter 1 Introduction to MATLAB

1 Overview of the standard Matlab syntax

16.06/16.07 Matlab/Simulink Tutorial

Introduction to Matlab

OUTLINES. Variable names in MATLAB. Matrices, Vectors and Scalar. Entering a vector Colon operator ( : ) Mathematical operations on vectors.

Starting with a great calculator... Variables. Comments. Topic 5: Introduction to Programming in Matlab CSSE, UWA

What is MATLAB and howtostart it up?

Introduction to MatLab. Introduction to MatLab K. Craig 1

AEMLog Users Guide. Version 1.01

How to Use MATLAB. What is MATLAB. Getting Started. Online Help. General Purpose Commands

An Introduction to Matlab5

Computational Modelling 102 (Scientific Programming) Tutorials

General Information. There are certain MATLAB features you should be aware of before you begin working with MATLAB.

MATLAB SUMMARY FOR MATH2070/2970

An Introduction to MATLAB II

Outline. CSE 1570 Interacting with MATLAB. Starting MATLAB. Outline (Cont d) MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An

AMATH 352: MATLAB Tutorial written by Peter Blossey Department of Applied Mathematics University of Washington Seattle, WA

EGR 111 Plotting Data

Introduction to Matlab

Matlab Tutorial. CS Scientific Computation. Fall /51

FlowJo Software Lecture Outline:

Starting MATLAB To logon onto a Temple workstation at the Tech Center, follow the directions below.

Getting Started with MATLAB

Transcription:

Chapter 1 Matlab Overview EGR1302 Desktop Command window Current Directory window Tb Tabs to toggle between Current Directory & Workspace Windows Command History window 1

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 2

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 3

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 or spaces separate elements in row Semi-colons separate rows 4

Variables Array assignment (cont) Special format for assigning row array with regularly l spaced numbers Type first number, last number, with spacing in middle All numbers separated by colon : u = [ 0 : 0.1:10 ] 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 u(7) 5

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 6

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 7

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 8

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 9

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 10

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 if expression Allow decision-making commands elseif expression commands else commands end 11

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 12