EasyManuals Logo

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 #113 background imageLoading...
Page #113 background image
js[i,1] ©... save row index
r[i]-n*(j-1)s[i,2] ©... find and save column index
endfor
endif
return s ©Return matrix of indices
EndFunc
The function returns an empty string ("") if the target value is not found. The calling program or function
can test the result with getType() to determine if there are any matching indices.
If the matrix m is
2 287
597 5
2039
8059
then indexmat(m,-2) returns the result
11
12
31
indicating that the element -2 is at indices [1,1], [1,2] and [3,1]. In the index matrix returned by
indexmat(), the first column is the row indices of the original matrix, and the second column is the
column indices. You can use rowDim() on the result matrix to determine the number of matching
elements.
As with the list index function, we can use indexmat() to find the indices of the minimum and maximum
matrix elements, but we must first use
matlist() in the argument of min() and max(), because those
functions return a row vector of column extrema for matrix arguments. So, to find the indices of the
minimum elements of matrix m, we use
indexmat(m,min(matlist(m)))
which returns [4,1], since there is only one element which is the minimum value of -8.
To find the maximum element indices, use
indexmat(m,max(matlist(m)))
which returns
22
34
44
and these are the indices of the maximum element 9.
indexmat() works on matrices of any row and column dimensions, and always returns a 2-column
matrix. Note that you can use a single row-index value to extract the individual indices for the result
matrix. For the example above, if we want the second index from the result, we use
[[2,2][3,4][4,4]][2]
which returns [3,4].
3 - 31

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