478 Appendix A: Functions and Instructions
8992APPA.DOC TI-89 / TI-92 Plus: Appendix A (US English) Susan Gullord Revised: 02/23/01 1:48 PM Printed: 02/23/01 2:21 PM Page 478 of 132
By combining the variations of
part()
, you can
extract all of the sub-expressions in the
simplified result of
expression1
. As shown in
the example to the right, you can store an
argument or operand and then use
part()
to
extract further sub-expressions.
Note: When using
part()
, do not rely on any
particular order in sums and products.
part(cos(p
ù
x+3))
¸
1
part(cos(p
ù
x+3),0)
¸
"cos"
part(cos(p
ù
x+3),1)
!
temp
¸
3+p
ø
x
temp
¸
p
ø
x+3
part(temp,0)
¸
"+"
part(temp)
¸
2
part(temp,2)
¸
3
part(temp,1)
!
temp
¸
p
ø
x
part(temp,0)
¸
"
ù
"
part(temp)
¸
2
part(temp,1)
¸
p
part(temp,2)
¸
x
Expressions such as (x+y+z) and (x
ì
y
ì
z)
are represented internally as (x+y)+z and
(x
ì
y)
ì
z. This affects the values returned for
the first and second argument. There are
technical reasons why
part(
x+y+z,1
)
returns
y+x instead of x+y.
part(x+y+z)
¸
2
part
(
x+y+z,2
)
¸
z
part
(
x+y+z,
1)
¸
y+x
Similarly, x
ù
y
ù
z is represented internally as
(x
ù
y)
ù
z. Again, there are technical reasons
why the first argument is returned as y
ø
x
instead of x
ø
y.
part(x
ù
y
ù
z)
¸
2
part
(
x
ù
y
ù
z,2
)
¸
z
part
(
x
ù
y
ù
z,
1)
¸
y
ø
x
When you extract sub-expressions from a
matrix, remember that matrices are stored as
lists of lists, as illustrated in the example to
the right.
part([a,b,c;x,y,z],0)
¸
"{"
part([a,b,c;x,y,z])
¸
2
part([a,b,c;x,y,z],2)
!
temp
¸
{x y z}
part(temp,0)
¸
"{"
part(temp)
¸
3
part(temp,3)
¸
z
delVar temp
¸
Done