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 #118 background imageLoading...
Page #118 background image
local mθ,k,l,d,dl
listmat(#mσ[1],1)mθ © Convert first data column to matrix
rowdim(mθ)d © Find row dimension
2k © Loop through remaining data columns
loop
#mσ[k]l © Convert column to a list
dim(l)dl © Find row dimension
if dl=0 then © Done when row dimension is zero
exit
elseif dld then © Error if row lengths not equal;
return "datamat() err" © return error string
else © Augment current column to matrix
augment(mθ,listmat(l,1))mθ
endif
k+1→k © Process next column
endloop
mθ © Return matrix
EndFunc
This conversion is useful if you want to use functions on data variables, because data variables cannot
be passed as function arguments. Use datamat() to convert the data variable to a matrix, then execute
the desired function.
To convert a data variable mydata to a matrix, use
datamat("mydata")
Note that the name of the data variable is passed as a string.
The code is straightforward, but is somewhat complicated because we cannot find the number of
columns in a data variable. However, I use the fact that a data variable column can be extracted to a
list with
datavar[k]list
and the dimension of list is zero if column k does not exist. This condition exits the loop.
The only error checking ensures that all the data variable columns have the same number of rows,
since this must be true for matrices. If the row dimensions are not equal, datamat() returns the string
"datamat() err" instead of the matrix. The calling program or function can use getType() on the result to
determine if an error occurred.
[3.30] Singular value decomposition (SVD) of a matrix
Singular value decomposition is a powerful tool for a variety of matrix-related tasks, including working
with matrices and sets of linear equations which are nearly singular. You can use SVD to remove the
singularities and get numerical results, but they may not be the results you expect. In addition, SVD
can be used for linear least-squares regression problems. A future version of this tip may demonstrate
some of those examples, but for now I will only present a good implementation of SVD, written by
Hernan Rivera. For now, if you would like to see how SVD is used, start with chapter 2.6 of Numerical
Recipes in Fortran, by Press, Teukolsky, Vetterling, and Flannery (http://www.nr.com).
SVD decomposes a matrix m with dimensions a x b (with a < b) into three matrices u, d and v such that
3 - 36

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