How To Create a Function in MATLAB English 393 Professor Harris May 10, 2011 Ava-Dawn Hammond Byung Kang Imelda Kwakye-Ackah Evelyn Ojo Adam Page.

Slides:



Advertisements
Similar presentations
Introduction to the SPL Interpreter
Advertisements

How can Microsoft PowerPoint 2007 help you share information?
COMPUTER PROGRAMMING Task 1 LEVEL 6 PROGRAMMING: Be able to use a text based language like Python and JavaScript & correctly use procedures and functions.
 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
Introduction to Excel Chapter 2 Excel Fundamentals Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Microsoft Excel The Basics. spreadsheet A type of application program which manipulates numerical and string data in rows and columns of cells. The value.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Introduction to Qualtrics for Online Surveys Claire Goverts; Office of Research Analysis, and Planning (RAP)
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
Practical Computing by Lynn Hogan
A Visual Introduction to PC SAS. Start SAS by double-clicking on the SAS icon...
RIMS II Online Order and Delivery System Tutorial on Downloading and Viewing Multipliers.
Business Computer Information Systems 1A Test 2: Word Basics, Basic Editing, and Formatting Text Lessons 1, 2, and 5 Microsoft Office XP Test 2 – REVIEW.
Exploring StarOffice 6.0 Tools StarOffice 6.0 Tools.
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.
With Internet Explorer 8© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 Go! with Internet Explorer 8 Getting Started.
RefWorks: Advanced February 13, What We’ll Cover Today Managing Your Personal Database Searching Your Personal Database Linking to the Full Text.
Windows Basics: Desktop, Taskbar and Window
Lecture 1: Introduction Lecture series based on the text: Essential MATLAB for Engineers and Scientists By Hahn & Valentine
1 Lesson 6 Exploring Microsoft Office 2007 Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
1 Lesson 6 Exploring Microsoft Office 2007 Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Exploring Microsoft Office Word 2007 Chapter 7 The Advanced User Robert Grauer, Keith Mulbery,
Tutorial 11 Using and Writing Visual Basic for Applications Code
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.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
Lesson 2 – Editing a Document Microsoft Word
© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures for Java William H. Ford William R. Topp Appendix E The EZJava.
Basic Computer and Word Functions, part 1 Read the information and use to answer the questions in the Basic Computer and Word Functions Study Guide.
Matlab Basics Tutorial. Vectors Let's start off by creating something simple, like a vector. Enter each element of the vector (separated by a space) between.
Productivity Programs Common Features and Commands.
PowerTeacher with Web Grade Book Semester Classes School Year August 2012.
Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! With Microsoft ® Office 2007 Intermediate Chapter.
CMPS 1371 Introduction to Computing for Engineers MatLab.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
Developed By Information Technology Services University Of Saskatchewan.
Chapter Two Creating a First Project in Visual Basic.
Chapter 3 The Visual Basic Editor. Important Features of the VBE Alt-F11 will open the Visual Basic Editor. The Code window is to the right, Project Explorer.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 6 Review: User Defined Functions Introduction to MATLAB 7 Engineering 161.
By Felixberto Dominic B. Eruela.  Using a computer to create, edit, and print documents. Of all computer applications, word processing is the most common.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
Lab 0 / Chapter 0 Windows XP Environment. 2 User Interfaces: A different perspective.
By: Gia Vuong Riyad Mahmud Narsimha Kalthy.  What is Mahara?  Logging into the ACS Portfolio  Using Mahara to Manage: ◦ Files ◦ Blogs ◦ External Feeds.
© 2010 Pearson Education, Inc. | Publishing as Prentice Hall1 Computer Literacy for IC 3 Unit 2: Using Productivity Software Chapter 1: Starting with Microsoft.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VII Introduction to SIMULINK Rajeev Madazhy
Lesson: 2 Common Features and Commands After completing this lesson, you will be able to: Identify the main components of the user interface. Identify.
Microsoft Word Level 1 Michael Carco. Word Level 1 Agenda  Word Basics  Navigating in a Document  Inserting and Modifying Text  Creating and Modifying.
PYP002 Intro.to Computer Science Microsoft Word1 Lab 04 - a Microsoft Windows Applications Common Features.
Introducing Dreamweaver. Dreamweaver The web development application used to create web pages Part of the Adobe creative suite.
Designing a Relational Database 13.4 Page A database should be created based on a design  Three steps Determine what information should be stored.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
2.1 First C Program. First Program Open visual studio, click new file Save as “programName.c” – Program must start with letter and have no spaces – Must.
LINGO TUTORIAL.
Dive Into® Visual Basic 2010 Express
Lesson 11 Exploring Microsoft Office 2007
POWERTEACHER PRO Quick Start – To get started immediately and begin taking advantage of PTP, perform the following tasks… Greetings Grader and welcome.
RefWorks: Advanced November 23, 2005.
Customizing the Quick Access Toolbar in Microsoft Office
International Computer Driving Licence Syllabus version 5.0
exploring Microsoft Office 2013 Plus
Lecture 1: Introduction
Introduction to Programming
M434/534 Numerical Linear Algebra MATLAB Tutorial Session (Fall 2010)
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
Introduction to Programming
Presentation transcript:

How To Create a Function in MATLAB English 393 Professor Harris May 10, 2011 Ava-Dawn Hammond Byung Kang Imelda Kwakye-Ackah Evelyn Ojo Adam Page

Introduction MATLAB is a computer program used in data analysis, algorithms, plotting of graphs, creating functions, etc.

Audience Anyone who is not familiar with MATLAB.

Objective To create a function using MATLAB.

Types of Functions in MATLAB Primary Function: contains the main program. Sub-functions: subroutines to the main function. Sub-functions are written within the same file, but in different sections. Nested functions: Similar to sub-functions, but are contained within another function. Anonymous functions: Quick method to make a function from any MATLAB expression. This can be done from within another function or at the MATLAB command prompt. Overloaded functions: Useful when creating a function that responds to different input types. Private functions: Gives a way to restrict access to a function. They can only be called from a function in the parent folder.

In this tutorial… Primary function All other functions are specialized versions of the primary function.

Procedures This is a procedure to make a simple function that greets a user. STEP 1 Launch the MATLAB application STEP 2 Click [File] → [New] → [Function]

Procedure (cont.) STEP3 MATLAB will automatically create a new function with default setup. The First line is function line [output_args] – what gets returned when the function is called. untitled – the name of the function [input_args] – inputs required to perform

STEP 4 Assign a name for function that gives some idea of what it does. It should start with a letter, usually lowercase.

STEP 5 Save the function as a.m file File name should be exactly the same as the function name you made at STEP 4. MATLAB puts the function name on the “Save As” section by default helloWorld.m

STEP 6 Define the input and output parameters by naming them. If the function does not require any input, insert a tilda (~) in the input segment. Give a brief description of the function on line directly below the function line. Output Name Input Name Description

STEP 7 Lastly, insert all code necessary to perform the function’s goal. codes

MATLAB Functional Environment Group 1 Icons: A) Create new.m file B) Open a.m file C) Save current.m file D) magic buttons – cut, copy, paste, undo, and redo.

MATLAB Functional Environment Group 2 Icons: Used to navigate through the program A) goes to the previous section of code B) goes to the next section of code C) selects a function within the.m file. Convenient if the file contains sub-functions.

MATLAB Functional Environment Group 3 Icons: debugging tools A) runs the function using the saved run configuration B) sets or clears breakpoint at current line C) clears all breakpoint in all currently open files D) ways to step through code during debug mode

MATLAB Functional Environment Group 4 Icons: Used for cell mode. Cell mode allows programs to be sectioned into parts, which makes searching and reading easier A) insert a new cell block (section) B) display all cell block titles C) shows cell mode information

Reference Etter, Delores, and David Kuncicky. Introduction to MATLAB 7. 1 st ed. Upper Saddle River, NJ: Pearson Prentice Hall, Print.