Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Get number The ginput command creates crosshairs. When the user clicks the x,y values of the crosshairs are returned."— Presentation transcript:

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

2 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.

3 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.

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

5 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.

6 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

7 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

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

9 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.


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

Similar presentations


Ads by Google