Get number The ginput command creates crosshairs. When the user clicks the x,y values of the crosshairs are returned.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Chapter 7 Introduction to Procedures. So far, all programs written in such way that all subtasks are integrated in one single large program. There is.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Why care about debugging? How many of you have written a program that worked perfectly the first time? No one (including me!) writes a program that works.
Flow Charts, Loop Structures
EGR 105 Foundations of Engineering I Fall 2007 – Week 1 Introduction.
Chapter 8 and 9 Review: Logical Functions and Control Structures Introduction to MATLAB 7 Engineering 161.
Example – calculating interest until the amount doubles using a for loop: will calculate up to 1000 years, if necessary if condition decides when to terminate.
Precedence Parentheses Arithemetic ^ * / + - (exception logical not ~ ) Relational > =
EGR 106 – Week 2 – Arrays & Scripts Brief review of last week Arrays: – Concept – Construction – Addressing Scripts and the editor Audio arrays Textbook.
Semester Project Introduction Computer control of a cutting machine 1. Given a data file description of desired 2-D parts 2. Create software tools to:
EGR 105 Foundations of Engineering I Fall 2007 – week 11 Presentation Tips.
Semester Project Introduction Computer control of a cutting machine 1. Given a data file description of desired 2-D parts 2. Create software tools to:
Project reports are due at the final Monday May 8 11:30 am Reports should contain a paragraph describing the contribution of each team member. Who did.
MATLAB and Simulinklecture 31 To days Outline  Functions  Strings  Sparse Arrays  Cell Arrays  Structures  Exercises on this days topics.
Testing a program Remove syntax and link errors: Look at compiler comments where errors occurred and check program around these lines Run time errors:
Week 7 - Programming II Today – more features: – Loop control – Extending if/else – Nesting of loops Debugging tools Textbook chapter 7, pages
Fundamentals of Python: From First Programs Through Data Structures
Programming a GUI Hanan sedaghat pisheh. For calling GUI, we need a function with no inputs or outputs First We create a m.file m file has the same name.
Advance Database Management Systems Lab no. 5 PHP Web Pages.
Using a Debugger. SWC What is ”debugging”? An error in a computer program is often called a ”bug”… …so, to ”debug” is to find and get rid of errors in.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
EGR 2261 Unit 5 Control Structures II: Repetition  Read Malik, Chapter 5.  Homework #5 and Lab #5 due next week.  Quiz next week.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Programming Concepts Chapter 3.
MAT Meyer Week 2 Programming VB: ‘basics’ Review & preview: Events, variables, statements, etc. Images, Control arrays, For/Next Assignment: read.
Tot 15 LTPDA Graphic User Interface summary and status N. Tateo 26/06/2007.
Using Client-Side Scripts to Enhance Web Applications 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
MA/CS 3751 Fall 2002 Lecture 24. MA/CS 3752 ginput ginput is a Matlab function which takes one argument input: number of points to select in the image.
Testing and Debugging Version 1.0. All kinds of things can go wrong when you are developing a program. The compiler discovers syntax errors in your code.
Introduction to Matlab’s Graphical User Interface (GUI) Type “guide” “Guide” creates interface on a Figure window and code in an M-file. Some hidden code.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
Advanced Topics- Functions Introduction to MATLAB 7 Engineering 161.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
Chapter 1 – Matlab Overview EGR1302. Desktop Command window Current Directory window Command History window Tabs to toggle between Current Directory &
ENG College of Engineering Engineering Education Innovation Center 1 Array Accessing and Strings in MATLAB Topics Covered: 1.Array addressing. 2.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
GUI development with Matlab: GUI Front Panel Components GUI development with Matlab: Other GUI Components 1 Other GUI components In this section, we will.
Lec 16 Chapter 10 Nov 2, 11 Chapter 10, user interface design examples.
Introduction to Excel VBA UNC Charlotte CPE/PDH Series December 17, 2009.
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
EGR 115 Introduction to Computing for Engineers MATLAB Basics 6: Debugging in MATLAB Monday 15 Sept 2014 EGR 115 Introduction to Computing for Engineers.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Introduction to Matlab Module #10 Page 1 Introduction to Matlab Module #10 – Creating Graphical User Interfaces Topics 1.Overview of GUI Development using.
Object-Oriented Application Development Using VB.NET 1 Chapter 11 Using Multiple Forms with Problem Domain Classes.
AVCE ICT – Unit 7 - Programming Session 12 - Debugging.
Structured Computer Programming EE 201 Introduction to MATLAB 7 for Engineers بسم الله الرحمن الرحيم King Abdulaziz University College of Engineering Dept.
A little PHP. Enter the simple HTML code seen below.
Development Environment
Topics Graphical User Interfaces Using the tkinter Module
Chapter Topics 15.1 Graphical User Interfaces
Console and GUI Programs
Chapter 4 MATLAB Programming
Functions CIS 40 – Introduction to Programming in Python
Scripts & Functions Scripts and functions are contained in .m-files
Microsoft Access Illustrated
Microsoft Office Illustrated
More on Graphical User Interfaces
Week 8 - Programming II Today – more features: Loop control
Designing and Debugging Batch and Interactive COBOL Programs
VISUAL BASIC.
Conditions and Ifs BIS1523 – Lecture 8.
Sirena Hardy HRMS Trainer
IPC144 Introduction to Programming Using C Week 4 – Lesson 2
Presentation transcript:

Get number The ginput command creates crosshairs. When the user clicks the x,y values of the crosshairs are returned.

Text handle Handles are labels that allow items to be addressed. Here the text at the coordinates x,y is given the handle htext(x,y). htext is an array that includes handles of text at other locations. Properties of the text are easily changed using its handle. get(h) returns all properties of the graphics object identified by the handle h and their current values. get(h,'PropertyName') returns the value of the property 'PropertyName' of the graphics object identified by h.

Erase text Here the text handle is used to modify the text property ‘string’, which is the actual text message. The text is replaced with the string ns(1) which is a blank. The result is that the text is erased. Since the text is erased the board has to be updated with a zero in the appropriate location. The row is 10-y so that the first row is at the top of the board in the plot at the coordinate x=9.

Check for integers 1-9 This code answers the question; Does the vector x, contain 9 integers from 1 to 9?

Check box This code converts the 9 elements in a 3x3 box to a row vector. It is part of a for loop that sequences through all the 9 boxes on the board.

Structured Programming Hierarchical Modules are divided into smaller and smaller submodules (functions work well as modules) functions contain functions Modular Simple independent modules with well defined inputs and outputs Locality Minimize inputs and outputs Generate values inside the module where possible

Debugging ≡ finding and correcting errors (bugs) in programs Useful debugging tools: –Ability to stop a program in the middle of its execution (at a breakpoint) –Ability to examine variable values at that point –Ability to modify variable values at that point

What shows up at the breakpoint Command window:Editor window: location indicator different prompt

Academic Integrity Academic Integrity: The following quote from Prof. Taggart's Egr106 web site applies. According to URI's policy on academic integrity, "cheating is the claiming of credit for work not done independently." While students are encouraged to help each other in completing homework assignments, each student is expected to submit work that they have developed on their own. Submission of duplicate copies of Matlab code is not acceptable. If you use someone else's code, you have to get their permission and acknowledge it in the code and in the report and presentation.