Texas Instruments TINSPIRE Reference Guide - Page 52

Value_If_false

Page 52 highlights

If If BooleanExpr1 Then Block1 ElseIf BooleanExpr2 Then Block2 © ElseIf BooleanExprN Then BlockN EndIf Allows for branching. If BooleanExpr1 evaluates to true, executes Block1. If BooleanExpr1 evaluates to false, evaluates BooleanExpr2, and so on. Catalog > ifFn( ) Catalog > ifFn(BooleanExpr,Value_If_true [,Value_If_false [,Value_If_unknown]]) ⇒ expression, list, or matrix Evaluates the boolean expression BooleanExpr (or each element from BooleanExpr ) and produces a result based on the following rules: • BooleanExpr can test a single value, a list, or a matrix. • If an element of BooleanExpr evaluates to true, returns the corresponding element from Value_If_true. • If an element of BooleanExpr evaluates to false, returns the corresponding element from Value_If_false. If you omit Value_If_false, returns undef. • If an element of BooleanExpr is neither true nor false, returns the corresponding element Value_If_unknown. If you omit Value_If_unknown, returns undef. • If the second, third, or fourth argument of the ifFn() function is a single expression, the Boolean test is applied to every position in BooleanExpr. Test value of 1 is less than 2.5, so its corresponding Value_If_True element of 5 is copied to the result list. Test value of 2 is less than 2.5, so its corresponding Value_If_True element of 6 is copied to the result list. Test value of 3 is not less than 2.5, so its corresponding Value_If_False element of 10 is copied to the result list. Value_If_true is a single value and corresponds to any selected position. Note: If the simplified BooleanExpr statement involves a list or matrix, all other list or matrix arguments must have the same dimension(s), and the result will have the same dimension(s). Value_If_false is not specified. Undef is used. imag( ) imag(Value1) ⇒ value Returns the imaginary part of the argument. imag(List1) ⇒ list Returns a list of the imaginary parts of the elements. One element selected from Value_If_true. One element selected from Value_If_unknown. Catalog > 46 TI-Nspire™ Reference Guide

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164

46
TI-Nspire™ Reference Guide
If
BooleanExpr1
Then
Block1
ElseIf
BooleanExpr2
Then
Block2
©
ElseIf
BooleanExprN
Then
BlockN
EndIf
Allows for branching. If
BooleanExpr1
evaluates to true, executes
Block1
. If
BooleanExpr1
evaluates to false, evaluates
BooleanExpr2
, and so on.
ifFn()
Catalog >
ifFn(
BooleanExpr
,
Value_If_true
[
,
Value_If_false
[
,
Value_If_unknown
]]
)
expression, list, or matrix
Evaluates the boolean expression
BooleanExpr
(or each element
from
BooleanExpr
) and produces a result based on the following
rules:
BooleanExpr
can test a single value, a list, or a matrix.
If an element of
BooleanExpr
evaluates to true, returns the
corresponding element from
Value_If_true
.
If an element of
BooleanExpr
evaluates to false, returns the
corresponding element from
Value_If_false
. If you omit
Value_If_false
, returns undef
.
If an element of
BooleanExpr
is neither true nor false, returns
the corresponding element
Value_If_unknown
. If you omit
Value_If_unknown
, returns undef.
If the second, third, or fourth argument of the
ifFn()
function is a
single expression, the Boolean test is applied to every position in
BooleanExpr
.
Note:
If the simplified
BooleanExpr
statement involves a list or
matrix, all other list or matrix arguments must have the same
dimension(s), and the result will have the same dimension(s).
Test value of
1
is less than 2.5, so its corresponding
Value_If_True
element of
5
is copied to the result list.
Test value of
2
is less than 2.5, so its corresponding
Value_If_True
element of
6
is copied to the result list.
Test value of
3
is not less than 2.5, so its corresponding
Value_If_False
element of
10
is copied to the result list.
Value_If_true
is a single value and corresponds to any selected
position.
Value_If_false
is not specified. Undef is used.
One element selected from
Value_If_true
. One element
selected from
Value_If_unknown
.
imag()
Catalog >
imag(
Value1
)
value
Returns the imaginary part of the argument.
imag(
List1
)
list
Returns a list of the imaginary parts of the elements.
If
Catalog >