Introduction to Matlab

Slides:



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

Introduction to MATLAB Week 13 – 4/21/09. Instructor: Kate Musgrave Time: Tuesdays 3-5pm Office Hours: Tuesdays 1:30-3pm
Introduction to MATLAB 7 for Engineers
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.
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.
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.
Introduction to MATLAB
Lecture 4 MATLAB Windows Arithmetic Operators Maintenance Functions
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 MATLAB LAB# 01
Numerical Computation Lecture 2: Introduction to Matlab Programming United International College.
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.
Introduction to MATLAB
Winter Semester 2014/2015 College of Engineering.
MATLAB Technical Computing Environment. MATLAB Matlab is an interactive computing environment that enables numerical computation and data visualization.
Introduction to Matlab
Introduction to MATLAB ENGR 1181 MATLAB 1. Opening MATLAB  Students, please open MATLAB now.  CLICK on the shortcut icon → Alternatively, select… start/All.
1 Week 1: Variables, assignment, expressions READING: 1.2 – 1.4.
Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz SUNY-New Paltz “Lecture 2”
Matlab. Textbooks Required:, by Palm (3 rd edition) Required: Introduction to MATLAB for Engineers, by Palm (3 rd edition)
1 CS1371 Introduction to Computing for Engineers Introduction to Matlab.
1 Lecture 1 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
EGR 115 Introduction to Computing for Engineers Introduction to MATLAB Friday 29 August 2014 EGR 115 Introduction to Computing for Engineers.
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.
Basics of Matlab UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Introduction to Matlab
Fundamentals of Programming 20-ENFD-112 Sections 001 to 007 Instructor: Prof. Dieter Schmidt Lecture: Monday, Wednesday 3:00-3:50 Web page
MATLAB Lecture 1 염익준. Introduction MATLAB (MATrix LABoratory) a special purpose computer program optimized to perform engineering and scientific calculations.
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.
Introduction to Matlab. Outline:  What is Matlab? Matlab Screen Variables, array, matrix, indexing Operators.
Introduction to MATLAB
ECE 1304 Introduction to Electrical and Computer Engineering
Release Numbers MATLAB is updated regularly
Introduction to Matlab
Lecture: MATLAB Chapter 1 Introduction
Basic operations in Matlab
2) Platform independent 3) Predefined functions
Introduction to MATLAB
INTRODUCTION TO BASIC MATLAB
MATLAB DENC 2533 ECADD LAB 9.
Introduction to Matlab
Matlab Workshop 9/22/2018.
Lecture 1: Introduction
StatLab Matlab Workshop
Use of Mathematics using Technology (Maltlab)
StatLab Workshop: Intro to Matlab for Data Analysis and Statistical Modeling 11/29/2018.
Plotting Data with MATLAB
Digital Image Processing
Introduction to Matlab
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
Experiment No. (1) - an introduction to MATLAB
Using Script Files and Managing Data
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.
Introduction to MATLAB
Basics of Matlab UC Berkeley Fall 2004, E Copyright 2005, Andy Packard
MatLab Program Used to Calculate Interactive
Chapter 2 MATLAB Environment
Electrical and Computer Engineering Department SUNY – New Paltz
Presentation transcript:

Introduction to Matlab By: Maha AlMousa

Outline: What is MATLAB? MATLAB desktop environment. Variables. Operations. Definition of algorithms. Introduction to M-files.

What is Matlab? MATLAB is an interactive system for numerical computation. MATLAB is a modern programming language and problem-solving environment.

MATLAB desktop environment. Command Window type commands

Example

Command History view past commands save a whole session using diary

Workspace View a list of variables created by MATLAB. Double click on a variable to see it in the Array Editor

Another way to create a variable

To assign a value to bbb

MATLAB special variables

Operators (arithmetic) + addition / division - Subtraction ^ power * multiplication

Operator precedence rules () parentheses. ^ power. - negation. */ \ all multiplication and division. + - addition and subtraction.

Example

Scripts and functions Scripts functions Both scripts and functions allow you to reuse sequences of commands by storing them in program files Scripts they store commands exactly as you would type them at the command line the simplest type of program functions more flexible and more easily extensible.

Some functions in MATLAB exp(x) 𝑒 𝑥 sin(x) sin 𝑥 asin(x) 𝑠𝑖𝑛 −1 𝑥 log(x) ln 𝑥 log10(x) log 𝑥 sqrt (x) 𝑥 abs(x) sum(x) pi 𝜋 NaN Not-a-Number Inf ∞ i,j imaginary unit

Example >>y=x^0.5; >>y=x^(1/2); >>y=sqrt(x);

Creating Variable Names Value Can be any string of upper and lower case letters along with numbers and underscores but it must begin with a letter Reserved names are IF, WHILE, ELSE, END, SUM, etc. Value This is the data the is associated to the variable; the data is accessed by using the name.

Definition of algorithms. An algorithm is the sequence of steps needed to solve a problem.

Introduction to m-file

The previous command will display the editor window The previous command will display the editor window. The editor creates an m-file that can be used to write your MATLAB programs.

To execute a program

Example Create a script in a file named triarea.m that computes the area of a triangle: b = 5; h = 3; a = 0.5*(b.*h) After you save the file, you can call the script from the command line: triarea a = 7.5000

function a = triarea(b,h) end

Home Work 1. Some calculations on the command window. 2. Create an M-file. Deadline: The tutorial lecture on Sunday 14-5-1440H