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 #98 background imageLoading...
Page #98 background image
Find the factorial of each integer element m1!m3
Find the sine of each element sin(m1)m3
(also works for cos(), ln(), etc)
Differentiate each array element with respect to x
(m1,x)m3
In general, more complex operations may be handled by nested for-loops that manipulate each array
element. Or, in some cases, it is more efficient to process the list elements in sequence. The function
below, transpos(), shows this approach.
transpos(arr,dims,i1,i2)
Func
©Example that transposes a rank-3 array on indices i1 and i2
©Bhuvanesh Bhatt (bbhatt1@towson.edu), Nov2000
Local i,tmp,arr2,dims2
If max(i1,i2)>dim(dims) or min(i1,i2)0:Return "Error: invalid indices"
newList(dim(arr))arr2
listswap(dims,i1,i2)dims2
For i,1,dim(arr)
m3aind(i,dims)tmp
m3sto(m3rcl(tmp,dims,arr),listswap(tmp,i1,i2),dims2,arr2)arr2
EndFor
arr2
EndFunc
Note that transpos() calls m3aind(), m3rcl() and m3sto(), as well as the listswap() function described in
tip 3.18. These examples show typical results for transpos().
transpos({a,b,c,d,e,f,g,h},{2,2,2},2,3) returns {a,c,b,d,e,g,f,h}
transpos({a,b,c,d,e,f,g,h},{2,2,2},1,2)
returns {a,b,e,f,c,d,g,h}
transpos() is limited to rank-3 arrays, but it can be extended by changing the function references
m3aind() and so on, as needed. Note that no error checking is done on the dims list or on the i1 and i2
input arguments, so make sure they are integers. As with a rank-2 array, the transpose function
changes the dimensions of the array: if a 1x2x3 array is transposed on the second and third indices,
the result is a 1x3x2 array. The dims2 variable in transpos() above gives the dimensions of the
resulting array.
If you are using Mathematica, note that regular cubic arrays in Mathematica can be converted to the
storage format used in this tip, with Flatten[array].
Bhuvanesh Bhatt has coded quite a few tensor functions and programs which use the representation
described in this tip. You can find them at his site, http://triton.towson.edu/~bbhatt1/ti/, in the Arrays
package. These functions include:
aInd(i,{dims})
Returns the array location corresponding to the ith list index for an array of dimensions dims
3 - 16

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