Texas Instruments TI-89 Tip List page 217

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

© Do the regression and calculate y = f(x)
quadreg l1,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 exit1
goto t1
© End up here, if user forgets to separate values with commas
lbl err1
dialog
text "x and y values must"
text "be separated with commas"
enddlog
goto t1
© Delete global variables before exiting
lbl exit1
delvar l1,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.
© Give user a chance to quit here
© Go try again
6 - 59

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92+

Table of Contents