{e
1,1,1
e
1,1,2
e
1,2,1
e
1,2,2
e
2,1,1
e
2,1,2
e
2,2,1
e
2,2,2
}
For a particular element location {a
1
, a
2
, a
3
}, we can find the corresponding list element index k from
[1]
k
=
a 3
+
a2
−
1 d3
+
a1
−
1 d2d3
This can be expanded and factored to eliminate one multiply, and access each variable only once, like
this:
[2]
k
=
d 3 d2 a1
−
1
+
a2
−
1
+
a3
The routines to save and recall elements to a 3-dimensional array are called m3sto() and m3rcl().
m3sto() looks like this:
m3sto(v,l,d,m)
Func
©(value,location{},dim{},matrix{})
©Store value in 3D matrix
©
1
2oct00 [email protected]
v
→
m[d[3]*(d[2]*(l[
1
]-
1
)+l[2]-
1
)+l[3]]
m
EndFunc
where
v
is the value to store in the array
l
is a 3-element list that specifies the element location as {a
1
, a
2
, a
3
}
d
is a 3-element list that specifies the list dimensions as {d
1
, d
2
, d
3
}
m
is the array list or the name of the array list
m3sto() returns the original array m with value v stored at location l.
For example, if we want to put 7 at location {1,2,3} in array mat1, which has dimensions 2 x 3 x 4, then
use this:
m3sto(7,{
1
,2,3},{2,3,4},mat
1
)
→
mat
1
To recall an array element, use m3rcl():
m3rcl(l,d,m)
Func
©(location{},dim{},matrix{})
©Recall element from 3D matrix
©
1
2oct00 [email protected]
m[d[3]*(d[2]*(l[
1
]-
1
)+l[2]-
1
)+l[3]]
EndFunc
where
l
is a 3-element list that specifies the element location as {a
1
, a
2
, a
3
}
3 - 11
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...