INTRODUCTION TO BASIC MATLAB

Slides:



Advertisements
Similar presentations
MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
Advertisements

Introduction to Matlab Workshop Matthew Johnson, Economics October 17, /13/20151.
MATLAB MATLAB is a high-level technical computing language and
Introduction to MATLAB 3 November Instructor: Andy Newman Office Hours: Stop by room 306 (main building) whenever
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.
Digital Image Processing Lecture3: Introduction to MATLAB.
259 Lecture 15 Introduction to MATLAB. 2 What is MATLAB?  MATLAB, which stands for “MATrix LABoratory” is a high- performance language for technical.
MATLAB Lecture One Monday 4 July Matlab Melvyn Sim Department of Decision Sciences NUS Business School
Nonparametric Econometrics1 Intro to Matlab for Data Analysis and Statistical Modeling.
Introduction to MATLAB adapted from Dr. Rolf Lakaemper.
Introduction to MATLAB Session 1 Prepared By: Dina El Kholy Ahmed Dalal Statistics Course – Biomedical Department -year 3.
You can make this in matlab!. Matlab Introduction and Matrices.
MATLAB Tutorials Session I Introduction to MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU.
Introduction to M ATLAB EE 100 – EE Dept. - JUST.
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.
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.
Eng Ship Structures 1 Introduction to Matlab.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
Basics of MATLAB By DR. Wafaa Shabana
Advanced Topics- Functions Introduction to MATLAB 7 Engineering 161.
Matlab 14.html Cost: $100 Available in labs on Windows and Unix machines.
ME6104: CAD. Module 4. ME6104: CAD. Module 4. Systems Realization Laboratory Module 4 Matlab ME 6104 – Fundamentals of Computer-Aided Design.
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.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
CIS 601 Fall 2003 Introduction to MATLAB Longin Jan Latecki Based on the lectures of Rolf Lakaemper and David Young.
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
Introduction to Matlab Patrice Koehl Department of Biological Sciences National University of Singapore
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
CIS 595 MATLAB First Impressions. MATLAB This introduction will give Some basic ideas Main advantages and drawbacks compared to other languages.
BASICS OF MATLAB Engr.Mian Shahzad Iqbal Lecturer,Telecom Department University of Engineering & Technology Taxila.
Matlab Tutorial (material available at 1 Dr. Jim Martin Associate Professor School of Computing.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
MATLAB ……………….matrix laboratory. Bhushan D Patil PhD Research Scholar Department of Electrical Engineering Indian Institute of Technology, Bombay Powai,
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
Matlab.
Introduction to MATLAB
Release Numbers MATLAB is updated regularly
Introduction to Matlab
Lecture: MATLAB Chapter 1 Introduction
MATLAB Basics Nafees Ahmed Asstt. Professor, EE Deptt DIT, DehraDun.
Introduction to MATLAB for Engineers, Third Edition
2) Platform independent 3) Predefined functions
Outline Matlab tutorial How to start and exit Matlab Matlab basics.
MATLAB DENC 2533 ECADD LAB 9.
Matlab Workshop 9/22/2018.
Introduction to MATLAB
StatLab Matlab Workshop
MATH 493 Introduction to MATLAB
Use of Mathematics using Technology (Maltlab)
StatLab Workshop: Intro to Matlab for Data Analysis and Statistical Modeling 11/29/2018.
Lecture 2 Introduction to MATLAB
Digital Image Processing
Communication and Coding Theory Lab(CS491)
Introduction to MATLAB
Introduction to Matlab
INTRODUCTION TO MATLAB
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
Matlab Basic Dr. Imtiaz Hussain
Experiment No. (1) - an introduction to MATLAB
Simulation And Modeling
CS 111 Introduction to Computing in Engineering and Science
Laboratory in Oceanography: Data and Methods
Presentation transcript:

INTRODUCTION TO BASIC MATLAB

Introduction MATLAB is a high-performance language for technical computing. It integrates computation, visualization, and programming where problems and solutions are expressed in familiar mathematical notation. Typical uses include: Math and computation Algorithm development Data acquisition Modeling, simulation, and prototyping Data analysis, exploration, and visualization Scientific and engineering graphics Application development, Including graphical user interface building

Introduction (Cont’) MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. This allows you to solve many technical computing problems, especially those with matrix and vector formulations. In university environments, it is the standard instructional tool for introductory and advanced courses in mathematics, engineering, and science. In industry, MATLAB is the tool of choice for high-productivity research, development, and analysis.

Introduction (Cont’) MATLAB features a family of add-on application-specific solutions called toolboxes. Toolboxes are comprehensive collections of MATLAB functions (M-files) that extend the MATLAB environment to solve particular classes of problems. Areas in which toolboxes are available include signal processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and many others.

The MATLAB System The MATLAB system consists of five main parts: i) Development Environment - This is the set of tools and facilities that help you use MATLAB functions and files. Many of these tools are graphical user interfaces. It includes the MATLAB desktop and Command Window, a command history, an editor and debugger, and browsers for viewing help, the workspace, files, and the search path. ii) The MATLAB Mathematical Function Library - This is a vast collection of computational algorithms ranging from elementary functions like sum, sine, cosine, and complex arithmetic, to more sophisticated functions like matrix inverse, matrix eigenvalues, Bessel functions, and Fast Fourier transforms.

The MATLAB System (cont’) iii) The MATLAB Language - This is a high-level matrix/array language with control flow statements, functions, data structures, input/output, and object-oriented programming features. It allows both "programming in the small to programming in the large" to create complete large and complex application programs. iv) Graphics - MATLAB has extensive facilities for displaying vectors and matrices as graphs, as well as annotating and printing these graphs. It includes high-level functions for two-dimensional and three-dimensional data visualization, image processing, animation, and presentation graphics. It also includes low-level functions that allow you to fully customize the appearance of graphics as well as to build complete graphical user interfaces on your MATLAB applications. v) The MATLAB Application Program Interface (API) - This is a library that allows you to write C and FORTRAN programs that interact with MATLAB. It includes facilities for calling routines from MATLAB (dynamic linking), calling MATLAB as a computational engine, and for reading and writing MAT-files.

Starting Matlab When you start MATLAB, 4 windows appear (by default): MATLAB Command Window Current Directory Window Workspace Window Command History Window

i) MATLAB Command Window: To communicate with MATLAB program, use MATLAB command window. MATLAB display the prompt (>> ) to indicate that it is ready to receive instructions.

ii) Current Directory Window: It is much like a file manager window. Used to access files. For example: file.m – it will open file in Matlab editor.

iii) Workspace Window: Display the variables created in the command window. Workspace refers to the names and values of any variable in-use in the current work session.

iv) Command History Window: All the previous keystrokes entered in Matlab Command Window showed here. You can click and drag the command into the Matlab command window or Matlab editor. You can alter the appearance of the desktop by clicking ViewDesktop layout.

Entering Commands and Expressions: Try out this 3-line command in Matlab Command Window: >> x=[0:002:8]; >> y=5*sin(x); >> plot(x,y): When you put semicolon (;) at the end of your command line, Matlab will not shows the answer of your commands/expressions. Example of mathematical expressions in Matlab prompt: >> 8/10 ans = 0.8000 >> 5*anw ans = 4

Variables A variable in Matlab is a symbol used to contain a value. When we do not specify a variable name for a result, Matlab uses the symbol ans as a temporary variable containing the most recent answer. Scalar variable: >> r=8/10 r = 0.8000 >> s=5*r s = 4

Variables (Cont’) Scalar arithmetic operations: Symbol Operation MATLAB form ^ Exponentiation: ab a^b * Multiplication: ab a*b / Right division: a/b a/b \ Left division: b/a a\b + Addition: a+b a+b - Subtraction: a-b a-b

Variables (Cont’) Variable names must begin with a letter and must contain less than 32 characters; contain letter, digits, and underscore. Matlab is case-sensitive; the following names represent different variables: speed, Speed, SPEED. Commands for managing the work session: >> clc : clear the command window. >> clear : removes all variables from memory. >> clear var1,var2 : removes the variables var1 and var2. >> quit : stops matlab >> who : lists the variables currently in memory >> whos :lists current variable and size. : :generates an array having regularly spaced elements. ; : suppresses screen printing, denotes a new row. , :separates elements of an array.

Computing with Matlab Matlab has the ability to handle collection of numbers, called array. Example of array variable: >> x= [0 1 3 6]; % 4-sequence of array >> u= [0 1; 2 1]; % 2x2 matrix >> y= [0:0.01:2]; >> length (y); % check total number of sequence-y >> y(7); % check the value of y in array-7 Polynomial roots: to find roots of >> a= [1, -7, 40, -34]; >> roots (a) Answer: roots of a: x=1, x=3+5i Built-in and User Defined Functions.

Computing with Matlab (cont’) Some commonly used mathematical function: Function MATLAB Syntax exp (x) sqrt (x) ln x log (x) Log10x log10(x) Cos x cos (x) Sin x sin (x) Tan x tan (x) Cos-1 x acos (x) Sin-1x asin (x) Tan-1x atan (x)