MATLAB Practice 2 Introducing MATLAB Lecture Notes on Video Search & Mining, Spring 2012 Presented by Jun Hee Yoo Biointelligence Laboratory School of.

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

1 Lecture 16:User-Definded function I Introduction to Computer Science Spring 2006.
Introduction to Matlab
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 19P. 1Winter Quarter MATLAB: Script and.
Example 2.
General Computer Science for Engineers CISC 106 Lecture 04 Roger Craig Computer and Information Sciences 9/11/2009.
1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
General Computer Science for Engineers CISC 106 Final Exam Review Dr. John Cavazos Computer and Information Sciences 05/18/2009.
General Computer Science for Engineers CISC 106 Lecture 08 Dr. John Cavazos Computer and Information Sciences 2/27/2009.
Exploring Windows 98 and Essential Computing Concepts - Chapter 2 1 Exploring the Internet Chapter 2 Search Engines: Finding Information on the Web.
General Computer Science for Engineers CISC 106 Lecture 26 Dr. John Cavazos Computer and Information Sciences 04/24/2009.
Promoting Code Reuse Often in programming, multiple procedures will perform the same operation IN OTHER WORDS – the same piece of code will do the same.
Introduction to MATLAB
Introduction to programming in MATLAB MATLAB can be thought of as an super-powerful graphing calculator Remember the TI-83 from calculus? With many more.
Digital Image Processing Lecture3: Introduction to MATLAB.
Towson University COSC 236
BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.
IE 212: Computational Methods for Industrial Engineering
Java CGI Lecture notes by Theodoros Anagnostopoulos.
Matlab Programming for Engineers Dr. Nidal Farhat Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Lesson 1 Introduction.
Introduction to Engineering MATLAB – 6 Script Files - 1 Agenda Script files.
Understanding the Semantics of Media Lecture Notes on Video Search & Mining, Spring 2012 Presented by Jun Hee Yoo Biointelligence Laboratory School of.
Object-Oriented Programming (OOP). Implementing an OOD in Java Each class is stored in a separate file. All files must be stored in the same package.
Function M-File Numerical Computing with. MATLAB for Scientists and Engineers.
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 6”
Functions CS 103 March 3, Review A function is a set of code we can execute on command to perform a specific task A function is a set of code we.
Functions CS 103. Review A function is a set of code we can execute on command to perform a specific task When we call a function, we can pass arguments.
MATLAB Practice 1 Introducing MATLAB Lecture Notes on Video Search & Mining, Spring 2012 Presented by Jun Hee Yoo Biointelligence Laboratory School of.
CMPS 1371 Introduction to Computing for Engineers MatLab.
User-defined Matlab functions. Creating function m-files with a plain text editor MATLAB m-files must be plain text files. Most word-processors provide.
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.
Methods. Methods also known as functions or procedures. Methods are a way of capturing a sequence of computational steps into a reusable unit. Methods.
Laboratory 2. LABORATORY OBJECTIVES This lab work is intended to give the students more insights on the Matlab environment and how to work more efficiently.
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
CISC105 – General Computer Science Class 8 – 06/28/2006.
General Computer Science for Engineers CISC 106 Lecture 12 James Atlas Computer and Information Sciences 08/03/2009.
Chapter 13. How to build an imitator in Imitation and Social Learning in Robots, Humans and Animals Course: Robots Learning from Humans Park, Susang
Dale Roberts Introduction to Java - Input, Program Control and Instantiation Dale Roberts, Lecturer Computer Science, IUPUI
Introduction to Programming on MATLAB Ecological Modeling Course Sep 11th, 2006.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
Chapter 4. Analysis of Brain-Like Structures and Dynamics (2/2) Creating Brain-Like Intelligence, Sendhoff et al. Course: Robots Learning from Humans 09/25.
Tips: 1. To insert your picture, click “Insert” –> “Picture”, select picture from your computer. (or just click the icon in the middle of page.) You can.
Computer Programming II Lecture 4. Functions - In C++ we use modules to divide the program into smaller and manageable code. These modules are called.
전자장 1 실험 - Matlab 사용법 - Photonic Systems Laboratory School of EE, Seoul National University Photonic Systems Lab School of EECS, S.N.U.
CS0004: Introduction to Programming
MATLAB The name of MATLAB stands for matrix laboratory. Starting a MATLAB Session -On Microsoft® Windows® platforms, start the MATLAB program by double-clicking.
Matlab Programming for Engineers
Introduction to Matlab
Introduction to Programming
EGR 115 Introduction to Computing for Engineers
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
Functions (subprograms)
L – Modelling and Simulating Social Systems with MATLAB
CS100J 26 April. Matlab Use help button!!! Variables, values, types
Use of Mathematics using Technology (Maltlab)
Introduction to Programming
Functions In Matlab.
Digital Image Processing
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
G. Pullaiah College of Engineering and Technology
Guideline Try to summarize to express explicitly
Software Engineering Lecture #29
OOP Aga private institute for computer science 5th grade
Parallel BFS for Maximum Clique Problems
Methods/Functions.
ME 123 Computer Applications I Lecture 5: Input and Output 3/17/03
How to Run a Java Program
Presentation transcript:

MATLAB Practice 2 Introducing MATLAB Lecture Notes on Video Search & Mining, Spring 2012 Presented by Jun Hee Yoo Biointelligence Laboratory School of Computer Science and Engineering Seoul National Univertisy

Function MATLAB Practice 2 – MATLAB Introduce © 2012, SNU CSE Biointelligence Lab.,

Function MATLAB functions Multiple input arguments Multiple returns void input arguments void returns © 2012, SNU CSE Biointelligence Lab., function [output1, output2] = foo(input1, input2, input3) Statements end function foo Statements end

Function In function statement You can use ‘return’ keyword but it’s not mandatory You must declare variable or matrix that has same name as outputs before return or end of function. © 2012, SNU CSE Biointelligence Lab., function [output1, output2] = foo(input1, input2, input3) Statements return; end function [output1, output2] = foo(input1, input2, input3) …. output1 = 1; output2 = 2; …. return; end

Function Create function_name.m in your MATLAB © 2012, SNU CSE Biointelligence Lab., Right Click on Browser Menu Or, just CTRL+N to call empty document.

Function Create function_name.m in your MATLAB © 2012, SNU CSE Biointelligence Lab., filename must be same as function name. (in our case, this file must be saved name as foo.m)

Functions One function_name.m must have one primal function which name is same as file name. One function_name.m can has multiple sub- functions which located under primal functions. © 2012, SNU CSE Biointelligence Lab.,

Functions © 2012, SNU CSE Biointelligence Lab.,

Functions © 2012, SNU CSE Biointelligence Lab., Scope of variables Scope of MATLAB is like C/C++ or JAVA Generally, every internal function variables – exclude return values - in function are removed when function is returned. But, with persistent keyword, internal function variables will remain after function returned.

Useful Tips help function_name | command_name show the description of function or command. lookfor keywords This command takes some time. © 2012, SNU CSE Biointelligence Lab.,