[3.28] Fill A List Or Matrix With A Constant; [3.29] Convert Data Variables To Matrices - Texas Instruments TI-89 Tip List

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

Advertisement

For j,i+1,n
m[j,i]→r
If not is_0(r) Then
r*m[i]-p*m[j]→m[j]
q*⁻p→q
EndIf
EndFor
EndFor
Return
1/q*‹(m[k,k],k,1,n-3)*(m[n-2,n-2]*(m[n-1,n-1]*m[n,n]-m[n-1,n]*m[n,n-1])-m[n-2,n-1]*(m[n-1
,n-2]*m[n,n]-m[n-1,n]*m[n,n-2])+m[n-2,n]*(m[n-1,n-2]*m[n,n-1]-m[n-1,n-1]*m[n,n-2]))
EndFunc

[3.28] Fill a list or matrix with a constant

The built-in Fill command will fill a list or matrix with a constant expression, but it is not a function and
cannot be used in TI Basic functions, nor return the result to the entry line. fill_lm() shown below is a
true function replacement for Fill, and also shows a method to use a single function to return either a
list or matrix.
fill_lm(e,d)
Func
©(expr,{dim}) or (expr,[row,col])
©Fill matrix or list
©23jun02/dburkett@infinet.com
local τ
gettype (d)→τ
© (This expression is all one line)
when(τ="LIST",seq(e,k,1,d[1]),when(τ="MAT",list▶mat(seq(e,k,1,d[1,1]*d[1,2]),d[1,2]),"fil
l_lm err"))
EndFunc
fill_lm() returns a filled list or matrix, as determined by the type of argument d. If d is a list, a list is
returned, and if d is a matrix, a matrix is returned. The contents of d specify the list or matrix
dimensions. For example,
fill_lm(a,{3})
fill_lm(a,[2,3])
If d is neither a list or a matrix, the error string "fill_lm err" is returned.

[3.29] Convert data variables to matrices

You can use the built-in NewData command to convert matrices to data variables, but there is no
complimentary command to convert data variables to matrices. This function does it:
datamat(mσ)
Func
©("name") convert data variable to matrix
©22dec01/dburkett@infinet.com
returns
{a,a,a}
a a a
returns
a a a
3 - 35

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92+

Table of Contents