การใช้งานโปรแกรม MATLAB ดร. อำนาจ ขาวเน. BASIC ELEMENTS OF MATLAB MATLAB Desktop MATLAB Editor Help System MATLAB (MATrix LABoratory)

Slides:



Advertisements
Similar presentations
Matlab Intro Simple introduction to some basic Matlab syntax. Declaration of a variable [ ] Matrices or vectors Some special (useful) syntax. Control statements.
Advertisements

Introduction to MATLAB The language of Technical Computing.
1 A L L A H. Command-Window Workspace & Directory Command- History The Matlab Command window - Finding your way around.
Introduction to Matlab
Introduction to MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
MATLAB – What is it? Computing environment / programming language Tool for manipulating matrices Many applications, you just need to get some numbers in.
Image Display MATLAB functions for displaying image Bit Planes
Image Processing in Matlab An Introductory Approach by Sabih D. Khan
Introduction to MATLAB and image processing. MATLAB and images The help in MATLAB is very good, use it! An image in MATLAB is treated as a matrix Every.
Maths for Computer Graphics
MATLAB for Image Processing April 10 th, Outline Introduction to MATLAB –Basics & Examples Image Processing with MATLAB –Basics & Examples.
Matrices and arrays Pekar Miriam. What is matrices? In MATLAB environment, a matrix is a rectangular array of number Vector - 1 by 1 row/ column matrix.
Laboratory of Image Processing Pier Luigi Mazzeo November 4 th, 2014.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
Introduction to Matlab Jianguo Wang CSSCR September 2009.
1 MATLAB 基礎. 2 MATLAB  Workspace: environment (address space) where all variables reside  After carrying out a calculation, MATLAB assigns the result.
MATLAB for Image Processing CS638-1 TA: Tuo Wang Feb 12 th, 2010.
MATLAB Lecture One Monday 4 July Matlab Melvyn Sim Department of Decision Sciences NUS Business School
Matlab tutorial course Lesson 2: Arrays and data types
MATLAB INTRO CONTROL LAB1  The Environment  The command prompt Getting Help : e.g help sin, lookfor cos Variables Vectors, Matrices, and Linear Algebra.
Martin Ellison University of Warwick and CEPR Bank of England, December 2005 Introduction to MATLAB.
Introduction to Matlab 1. Outline: What is Matlab? Matlab Screen Variables, array, matrix, indexing Operators Plotting Flow Control Using of M-File Writing.
Sundermeyer MAR 550 Spring Laboratory in Oceanography: Data and Methods MAR550, Spring 2013 Miles A. Sundermeyer Image Processing/Analysis.
Matlab tutorial course Lesson 5: Loading and writing data, producing visual output
Introduction to MATLAB
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 MATLAB LAB# 01
Gulsah Tumuklu Ozyer MATLAB IMAGE PROCESSING TOOLBOX.
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
CS112 Scientific Computation Department of Computer Science Wellesley College Numb3rs Number and image types.
Matlab The language of Technical computing Mr. D. Suresh Assistant Professor, Dept. of CSE, PSNA CET, Dindigul.
MATLAB Environment ELEC 206 Computer Applications for Electrical Engineers Dr. Ron Hayne.
Lecture 2 - Matlab Introduction CVEN 302 June 5, 2002.
Getting Started with MATLAB CS534 TA: Matt McDaniel Sep 17 th, 2012 Slides by Chunhui Zhu – Fall 2011 Thanks to the help from Tuo.
Introduction MATLAB stands for MATrix LABoratory.  Basics  Matrix Manipulations  MATLAB Programming  Graphics  Image types  Image Processing  Useful.
Digital Image Processing Lecture4: Fundamentals. Digital Image Representation An image can be defined as a two- dimensional function, f(x,y), where x.
Introduction to Matlab. What is Matlab? A software environment for interactive numerical computations Examples:  Matrix computations and linear algebra.
Matlab Screen  Command Window  type commands  Current Directory  View folders and m-files  Workspace  View program variables  Double click on a.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz SUNY-New Paltz “Lecture 2”
EGR 115 Introduction to Computing for Engineers MATLAB Basics 3: Array Operations Monday 08 Sept 2014 EGR 115 Introduction to Computing for Engineers.
Matlab Basic. MATLAB Product Family 2 3 Entering & Quitting MATLAB To enter MATLAB double click on the MATLAB icon. To Leave MATLAB Simply type quit.
CMPS1371 Introduction to Computing for Engineers IMAGES.
Outline Introduction to MATLAB Image Processing with MATLAB
The Hong Kong Polytechnic University Industrial Centre MatLAB Lesson 1 : Overview & Environment Edward Cheung Room W311g.
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.
CSE 455 : Computer Vision MATLAB 101 Getting Started with MATLAB.
Lecture 27: Image Processing
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started.
Image Representation Last update st March Heejune Ahn, SeoulTech.
Digital Image Processing. Converting between Data Classes The general syntax is B = data_class_name (A) Where data_class_name is one of the names defined.
Introduction to MATLAB Ehsan Adeli M. Iran University of Science and Technology, E-Learing Center, Fall 2008 (1387)
Introduction to Matlab Engr. Mian Shahzad Iqbal LAB NO.2
An Introduction to Programming in Matlab Emily Blumenthal
Beginning Programming for Engineers Animation. Special matrix functions >> clear >> ones(2,3) >> zeros(3,5) >> ones(2) >> zeros(3) >> eye(4) >> magic(4)
Matlab & Image processing toolbox Heejune Ahn SeoulTech Last updated Jan.
Basics of MATLAB 2- Programming in MATLAB By DR. Wafaa Shabana
Computer Application in Engineering Design
Signals in Matlab Matlab as a name stands for Matrix Laboratory.
Ch3 Graphics Overview of Plotting Editing Plots
Digital Image Processing using MATLAB
CSE107 Matlab Introduction
CSE 307 Basics of Image Processing
Fundamentals of Image Processing Digital Image Representation
MATLAB stands for MATrix LABoratory.
Introduction to Image Processing with MATLAB
ME 123 Computer Applications I Lecture 5: Input and Output 3/17/03
Presentation transcript:

การใช้งานโปรแกรม MATLAB ดร. อำนาจ ขาวเน

BASIC ELEMENTS OF MATLAB MATLAB Desktop MATLAB Editor Help System MATLAB (MATrix LABoratory)

who, whos – current variables in the workspace save – save workspace variables to *.mat file load – load variables from *.mat file clear – clear workspace variables clc clear screen

Data Classes

Basic Operators

MATLAB Array and Matrix Arithmetic Operators

Example of matrix operation

How to input a row or column vector

How to input a matrix a row at a time

How to change entries in a given matrix A

Creating M-files Input M-function name must start with the word function Output

Graphics x = -pi:.1:pi; y = sin(x); plot(x,y) set(gca,'XTick',-pi:pi/2:pi) set(gca,'XTickLabel',{'-pi','-pi/2','0','pi/2','pi'}) title('Sine Function'); xlabel('Radians'); ylabel('Function Value');

subplot Create axes in tiled positions

Images in Matlab Reading, writing and querying images

Basic display of images

imagesc function The imagesc function scales image data to the full range of the current colormap and displays the image.

Images in MATLAB Binary images : {0,1} Intensity images : [0,1] or uint8, double etc. RGB images : m-by-n-by-3 Indexed images : m-by-3 color map Multidimensional images m-by-n-by-p (p is the number of layers)

Image import and export Read and write images in Matlab >> I=imread('cells.jpg'); >> imshow(I) >> size(I) ans = (RGB image) >> Igrey=rgb2gray(I); >> imshow(Igrey) >> imwrite(lgrey, 'cell_gray.tif', 'tiff') Alternatives to imshow >>imagesc(I) >>imtool(I) >>image(I)

Images and Matrices How to build a matrix (or image)? >> A = [ 1 2 3; 4 5 6; ]; A = >> B = zeros(3,3) B = >> C = ones(3,3) C = >>imshow(A) (imshow(A,[]) to get automatic pixel range)

Images and Matrices Accesing image elements (row, column) >> A(2,1) ans = 4 : can be used to extract a whole column or row >> A(:,2) ans = or a part of a column or row >> A(1:2,2) ans = 2 5 X Y A =

Image Arithmetic Arithmetic operations such as addition, subtraction, multiplication and division can be applied to images in MATLAB – +, -, *, / performs matrix operations >> A+A ans = >> A*A ans = To perform an elementwise operation use. (.*,./,.*,.^ etc) >> A.*A ans = A =

Converting image types

References “Fundamentals of Digital Image Processing A Practical Approach with Examples in Matlab”, by Chris Solomon and Toby Breckon “MATLAB for Image Processing” by Tuo Wang,Feb 12th, 2010 “MATLAB Tutorial” MIT OpenCourseWare Algebra