Texas Instruments TI-89 Tip List page 125

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

Advertisement

©xyn: xy data plot number
©fplot: function to plot; expression
©fpn: function plot number
local umode,gmode
©Save user's modes
getmode("ALL")→umode
stogdb gmode
©Set graph modes as needed
setmode({"Graph","Function","Split Screen","Full"})
©Clear previous graph contents
clrgraph
clrdraw
fnoff
plotsoff
©Get number of data points
rowdim(xyspec)→xyrows
©Convert xy data points to lists
mat▶list(submat(xyspec,1,1,xyrows,1))→xlist
mat▶list(submat(xyspec,1,2,xyrows,2))→ylist
©Plot the data and zoom to fit
newplot xyn,1,xlist,ylist
zoomdata
©Plot the function & trace
expr(string(fplot)&"→y"&string(exact(fpn))&"(x)")
trace
©Restore user's modes
delvar xlist,ylist
setmode(umode)
rclgdb gmode
disphome
endprgm
In this program, xyspec is the matrix (or name of the matrix) of the data points to plot. fplot is the
function to plot, which must have an argument of x. xyn and fpn specify which plot number to use for
the data and function plots, respectively. For example, this call:
plotdemo(xydata,1,sin(x),2)
plots the points in xydata as plot number 1, and the the function sin(x) as graph function y2(x).
Beyond all the house-keeping (saving the user's modes, and so on), the critical features of the program
are these:
! Convert the matrix data to lists, to use the newplot() function. Note that these lists must be global
variables to use newplot(), so the variables are deleted before the program exits.
! Use zoomdata after plotting the data, but before plotting the function, to scale the graph to the data.
! Use expr() on a string that assigns the input function to a y-function for plotting.
! Plot the function after plotting the data.
4 - 5

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92+

Table of Contents