HP 9g Graphing Debugging a Program, Using the Graph Function in Programs, Display Result Command

Page 30

Debugging a Program

A program might generate an error message or unexpected results when it is executed. This indicates that there is an error in the program that needs to be corrected.

Error messages appear for approximately 5 seconds, and then the cursor blinks at the location of the error.

To correct an error, select EDIT from the program menu.

You also can select TRACE from the program menu. The program is then checked step-by-step and a message alerts you to any errors.

Using the Graph Function in Programs

Using the graph function within programs enables you to graphically illustrate long or complex equations and to overwrite graphs repeatedly. All graph commands (except trace and zoom) can be included in programs. Range values can also be specified in the program.

Note that values in some graph commands must be separated by commas () as follows:

Range ( Xmin, Xmax, Xscl, Ymin, Ymax, Yscl )

Factor ( Xfact, Yfact )

Plot ( X point, Y point )

Display Result Command

You can put in a program if you want to be able to see the value of a variable at that particular stage in program execution.

For example:

Line 1: INPUT A ; B = ln ( A + 100 )

Line 2: C = 13 × A ; -------Stop at this point

Line 3: D = 51 / ( A × B )

Line 4:PRINT ” D = ”, D ; END

1.Execution is interrupted at the point where you placed .

2.At this time, you can press [ 2nd ] [ RCL ] to view the value of the corresponding memory variable (C in the above example).

3.To resume program execution, press [].

Deleting a Program

1.Select DEL from the program menu and press [].

2.To erase a single program, select ONE, the program area you want to

erase, and then press []

E-30

Image 30
Contents Hp 9g Graphing Calculator Contents Other Functions x-1, , , ,x 2, x Statistical CalculationsProgramming Power Supply Contrast AdjustmentDisplay Features Changing Modes Selecting an Item from a MenuKey Labels Using the 2nd and Alpha keys CursorInserting and Deleting Characters Recalling Previous Inputs and Results MemoryOrder of Operations Accuracy and Capacity RandiDMS Error Conditions StatArithmetic Calculation Display FormatRepeat Calculations Parentheses CalculationsPercentage Calculations Answer FunctionLogarithm and Antilogarithm Fraction CalculationConverting Angular Units Coordinate Transformations Trigonometric and Inverse Trigonometric functionsHyperbolic and Inverse Hyperbolic functions Mathematical FunctionsUnit Conversion Physics Constants Multi-statement functions Built-in Function GraphsUser-generated Graphs Superimposing Graphs Graph ↔ Text Display and Clearing a GraphZoom Function Trace FunctionScrolling Graphs Plot and Line FunctionSingle-Variable and Two-Variable Statistics Process Capability Correcting Statistical Data Probability Distribution 1-Var DataRegression Calculation QuadNegative Expressions Basic Arithmetic Operations for BasesLogical Operation Before Using the Program Area Program Control InstructionsInput memory variable END Relational Operators Creating a New ProgramExecuting a Program Debugging a Program Using the Graph Function in ProgramsDisplay Result Command Deleting a ProgramProgram Examples × 5 + 56 7 74 8 × 7 = × 5 M+ MRC × 7 2nd M MRC MRC CL / ESC Example Prog 1 CL / ESC + 10 × 8 2 = 12369 × 7532 × 2nd SCI / ENG 20 2nd ENG SYM + 0.15 2nd ENG SYM 55 2nd % 2nd ANS B/c 2 a b/c 2nd a b/c d/e 2nd 2nd DMS Cosh1.5+2 = 2nd HYP cos Sinh -17 = 2nd HYP 2nd sin 2nd R P Alpha Page Page Page 26 7 ! 7 4 ! = Math Math Math Math 27 7 ! 7 4 ! × 4 = 2nd 30 7 4 = × 2nd Const Graph 2nd e Example Range Graph Alpha X 2nd x 3 + Alpha X x 2 Graph Alpha X + Graph cos Trace 2nd X Y Page Example 2nd Statvar Graph Example Example 2nd Statvar Example Nd Statvar Graph 2nd Statvar 573 Data 101 61 117 67 2nd Statvar Graph Nd Statvar 143 31 10 = 1F16 = 11111 2 = 37 Mode Dhbo Mode 2 dhbo Dhbo 4777 Mode 2 dhbo Dhbo 1234 + IE if Example RUN Seconds Seconds Example X 2 7 X + 5 = 0 X 1 = 2.5 , X 2 = 25 X 2 70 X + 49 = 0 X = 2 + 2 X + 5 = 0 X 1 = 1 + 2 i , X 2 = 1 2 When the message 1 AN, 2 SN appears on the display, you can = 3 , D = 2, N = 12 S N = S 12 = Seconds RUN Page Example Example RUN 486 Seconds Example Edit Dhbo 11011 = 10 C = 130 , D = 2nd RCL CL/ESC
Related manuals
Manual 2 pages 9.13 Kb