© Do the regression and calculate y = f(x)
quadreg l
1
,l2
regeq(x)
→
res
© Display the result
dialog
title "QUADINT RESULT"
text "x = "&string(x)
text "y = "&string(res)
text "y saved in 'res'"
text "(Push ESC to quit)"
enddlog
if ok=0:goto exit
1
© Give user a chance to quit here
goto t
1
© End up here, if user forgets to separate values with commas
lbl err
1
dialog
text "x and y values must"
text "be separated with commas"
enddlog
goto t
1
© Go try again
© Delete global variables before exiting
lbl exit
1
delvar l
1
,l2
EndPrgm
This program just provides a convenient interface for entering the xy-data points and displaying the
result. Since the user might want to do several interpolations before quitting, the program loops to
repeat the interpolations. The user can press [ESC] at any dialog box to quit the program. The
interpolation result is saved in a global variable res, which can be recalled at the home screen after
exiting quadint(). The global list variables are deleted when the user quits the program.
quadint() calls the function str2var() to process the user's input. str2var() must be in the same folder as
quadint(), but they may be in any folder. You must make that folder current with setfold() before
running quadint(). str2var() is shown at the end of this tip.
When the program is executed, this dialog box is shown:
Each xy-data pair is entered in a single Request field; see tip [9.13] for more details on this. The x- and
y-data values are separated with a comma. An error message is shown if the user forgets to use the
comma. The picture above shows the fields filled in with the values for the example above. When all
the values are entered, the user presses [ENTER] to do the interpolation. Another dialog box is shown
with the interpolation result.
6 - 59
Summary of Contents for TI-92+
Page 52: ...Component side of PCB GraphLink I O connector detail 1 41...
Page 53: ...LCD connector detail PCB switch side 1 42...
Page 54: ...Key pad sheet contact side Key pad sheet key side 1 43...
Page 55: ...Key cap detail 1 44...
Page 57: ...Component side of PCB with shield removed A detail view of the intergrated circuits 1 46...
Page 410: ...void extensionroutine2 void Credit to Bhuvanesh Bhatt 10 4...