columns with an equal number of rows. Since the program refers to the data variable, indirection is
used (the # operator), and the data variable name is passed as a string. For example, to modify a data
variabled named tdata, call datalist() like this:
datalist("tdata")
Note that the columns of data variables can be accessed with the column number in square brackets:
#adata[
1
]
returns the first column of the data variable named in adata. The column is returned as a list.
Note that this method will not work in a function, because the newdata instruction cannot be used in a
function.
It is not necessary to convert the data variable to a matrix. You can just convert the variable to lists, as
shown in the example, make the necessary changes to the list elements, then convert the lists back to
a data variable like this:
NewData #adata,alist
1
,alist2
[3.9] Replace matrix rows and columns
Sometimes you need to replace an entire matrix row with a different set of values. For example,
suppose you have this matrix:
a
=
1 2 3
4 5 6
7 8 9
and you want to change the second row to [40, 50 ,60]. This is easily done with
[40,50,60]
→
a[2]
In this case, a[2] is interpreted as the second row of matrix a. Now the matrix looks like this:
a
=
1
2
3
40 50 60
7
8
9
Unfortunately, replacing columns is not so easy. There is a method that will work in most cases.
Suppose we want to change the second column in the original matrix to [20, 50, 80]. These steps
accomplish the change:
a
→
b
[20,50,80]
→
b[2]
b
→
a
The basic idea is to use the matrix transpose operator, to convert the matrix columns to rows. Then,
the new 'column' is inserted as a row. Finally, the transpose operator is used again to convert the
matrix rows back to columns. Note that this will work even if the matrix elements are complex numbers.
(Credit for row replacement method to Glenn Fisher)
3 - 5
Summary of Contents for TI-92+
Page 52: ...Component side of PCB GraphLink I O connector detail 1 41...
Page 53: ...LCD connector detail PCB switch side 1 42...
Page 54: ...Key pad sheet contact side Key pad sheet key side 1 43...
Page 55: ...Key cap detail 1 44...
Page 57: ...Component side of PCB with shield removed A detail view of the intergrated circuits 1 46...
Page 410: ...void extensionroutine2 void Credit to Bhuvanesh Bhatt 10 4...