EasyManuals Logo
Home>Texas Instruments>Calculator>TI-89

Texas Instruments TI-89 Tip List

Texas Instruments TI-89
507 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #101 background imageLoading...
Page #101 background image
This is a well known way to exchange two elements. I include it only because you might be tempted, as
I was, to do it in a more convoluted way. Note that this function takes advantage of the fact that you
can write to the function arguments. In this case, the elements of list are written directly to list, then list
is returned.
This function executes in about 0.17 seconds on a TI92+ with AMS 2.05. For even better speed, don't
call the function, just use the three lines that perform the swap. Those three lines execute in about
0.099 seconds.
[3.19] Test a list for identical elements
If you need to know if all the elements of a list are identical, try this function:
lstident(l)
Func
©(list) return true if all elements of 'list' are the same
©18jan01/dburkett@infinet.com
when(„list(l)=newlist(dim(l)-1),true,false)
EndFunc
The function returns true if all the list elements are equal, and false otherwise. The basic idea is to use
„list() to create a list of the differences between the elements, then compare that result to a list of
zeros.
This function works if the list elements are numbers (including complex numbers) or strings, but does
not work if the list elements are expressions. If the elements are all the same expression, lstident()
returns true, but if the elements are not the same, lstident() returns itself. It is a little odd that this
method works for lists of strings, since newlist() returns a list with all zero elements, but
„list("a","a","a") returns {0,0}
and
„list("a","a","b") returns {0,"b-a"}
Since "b-a" is a string, and strings test as 'not equal' to numbers, it works.
Note that the when() function is necessary, otherwise the expression will return a list of true and false
elements, instead of a single true or false.
[3.20] Find matrix minimum and maximum
The built-in functions min() and max() return a row vector whose elements are the minimum and
maximum, respectively, of the matrix rows. If you need the single minimum or maximum matrix
element, use this to find the minimum matrix element of matrix mat1
min(matlist(mat1))
and this to find the maximum matrix element
max(matlist(mat1))
3 - 19

Table of Contents

Other manuals for Texas Instruments TI-89

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-89 and is the answer not in the manual?

Texas Instruments TI-89 Specifications

General IconGeneral
Display size (HxV)100 x 160 mm
Memory type639K FLASH ROM, 188K bytes RAM
Compatible operating systemsOperating System 2.09
Battery typeAAA

Related product manuals