Using Variables. Texas Instruments TI-Nspire CX
Below you will find brief information for TI-Nspire CX. This teacher software lets educator use PC and Mac computers to emulate handheld calculators, manage files, and interact with connected handhelds. It includes features for creating and editing documents, presenting lessons, and assessing student understanding.
Advertisement
Advertisement
Using Variables
A variable is a defined value that can be used multiple times in a problem. You can define a value or function as a variable within each application. Within a problem, variables are shared by TI-Nspire™ applications. For example, you can create a variable in Calculator, and then use or modify it in Graphs &
Geometry or Lists & Spreadsheet within the same problem.
Each variable has a name and a definition and the definition can be changed.
When you change the definition, all occurrences of the variable in the problem are updated to use the new definition. In the TI-Nspire™ software, a variable has four attributes:
• Name - User-defined name assigned when the variable is created.
• Location - Variables are stored in memory.
• Value - Number, text, mathematical expression, or function.
• Type - Type of data that can be stored as a variable.
Note
: Variables created with the
Local command within a user-defined function or program are not accessible outside that function or program.
Linking Values on Pages
Values and functions created or defined in one application can interact with other applications (within the same problem) to share data.
When using linked items, keep in mind:
• Values can be linked between applications on one page or between different pages of the same problem.
• All applications are linked to the same data.
• If the linked value is changed in the original application, the change is reflected in all linked usages.
Defining a variable is the first step in linking values.
Creating Variables
Any portion or attribute of an object or function created within an application can be stored as a variable. Examples of attributes that can become variables are the area of a rectangle, the radius of a circle, the value contained in a
Using Variables 229
spreadsheet cell or the contents of a row or column, or a function expression.
When you create a variable, it is stored in memory.
Types of Variables
You can store the following data types as variables:
Data type
Expression
Examples
2.54 1.25E6 2p xmin/10 2+3i (xN2)
2
List {2, 4, 6, 8} {1, 1, 2} {"red", "blue", "green"}
Matrix
This can be entered as: [1,2,3;3,6,9]
Character string “Hello” “xmin/10” “The answer is:”
Function, program myfunc( arg ) ellipse( x, y, r1, r2 )
Measurement area, perimeter, length, slope, angle
When you click or press h on a handheld to open the list of stored variables, a symbol indicates the type.
Creating a Variable from a Calculator Value
This example shows how to create a variable using a handheld. Complete the following steps to create a variable named
num
and store the result of the expression 5+8
3 in that variable.
1.
On the Calculator entry line, type the expression 5+8^3.
230 Using Variables
2.
Press
¢ to expand the cursor to the baseline.
3.
Press
/ h and then type the variable name num.
This means: Calculate 5+8
3 and store the result as a variable named
num
.
4.
Press
·
.
Calculator creates the variable
num
and stores the result there.
Creating a Variable in the Computer Software
When creating a variable in the computer software, use the following conventions. As alternatives to using
&
(store), you can use “:=” or the Define command. All of the following statements are equivalent.
5+8
3
&
num num
:= 5+8
3
Define
num
=5+8
3
Checking a Variable’s Value
You can check the value of an existing variable by entering its name on the
Calculator entry line. When you type the name of a stored variable, it appears in bold type.
▶
On the Calculator entry line, type the variable name num and press
·
.
The value most recently stored in
num
is displayed as the result.
Automatically Creating Variables in Graphs & Geometry
In the Graphs and Geometry applications, functions defined on the entry line are automatically stored as variables.
Using Variables 231
In this example, f1(x)=x
3 is a variable definition, which allows it to be displayed in other applications including a table in the Lists & Spreadsheet application.
Creating a Variable from a Graphs & Geometry Value
1.
Click the value to store as a variable.
2.
Click .
Handheld: Press h
.
The Variables options are displayed with
Store Var highlighted.
3.
Press
·
. VAR := appears before the selected value. This is the default name.
232 Using Variables
4.
Replace the default name VAR with the variable name you want to give the value.
5.
When the variable name is typed, press
·
.
The value is saved to that variable name, and the stored value or its name appears in bold text to indicate it is a stored value.
Note:
You can also share a Graphs & Geometry axis end value with other applications. If necessary, click Actions , Show/Hide Axes End Values to display the end values on the horizontal and vertical axes. Click the number for an end value to highlight it in the entry field. Name the variable and store it for use with other applications by using any method described in Step 2.
Automatically Creating Variables in Lists & Spreadsheet
Naming a list at the top of a Lists & Spreadsheet column automatically stores that value as a list variable. This variable can be used in other applications including Data & Statistics.
Using Variables 233
Creating a Variable from a Lists & Spreadsheet Cell Value
You can share a cell value with other applications. When defining or referring to a shared cell in Lists & Spreadsheet, precede the name with an apostrophe
(‘).
1.
Click the cell that you want to share.
2.
Click to open the Variables menu.
Handheld: Press h
.
3.
Click Store Var .
A formula is inserted into the cell with
var
as a placeholder for a variable name.
4.
Replace the letters “
var
” with a name for the variable, and press
·
.
The value is now available as a variable to other applications within the same problem.
234 Using Variables
Note:
If a variable with the name you specified already exists in the current problem space, Lists & Spreadsheet displays an error message.
Using (Linking) Variables
Sharing, or linking, the variables you create is a powerful tool for math exploration. The display of linked variables is automatically updated when the variable’s value changes.
Linking to Shared Variables
To use a stored variable:
1.
Display the page and select the location or object to which you want to link a variable.
2.
Select the Variables tool h
.
The Variables options are displayed. The software knows which types of variables will work in the location or with the object selected and will only display those variables.
3.
Use 9 and : to scroll the list.
—or—
Type part of the variable name.
As you type, the system displays a list of variables that begin with the letters you typed. Typing part of the name enables you to locate a variable more quickly if the list is long.
4.
When you locate and highlight the name of the variable you want to use, click the name.
—or—
Press
·
.
The selected variable value is linked.
Linking a Lists & Spreadsheet Cell to a Variable
When you link a cell to a variable, Lists & Spreadsheet keeps the cell value updated to reflect the current value of the variable. The variable can be any variable in the current problem and can be defined in Graphs & Geometry,
Calculator, or any instance of Lists & Spreadsheet.
Using Variables 235
Note:
Do not link to a system variable. Doing so could prevent the variable from being updated by the system. System variables include
ans
,
StatMatrix
, and statistics results (such as
RegEqn
,
dfError
, and
Resid
).
1.
Click the cell that you want to link to the variable.
2.
Open the VarLink menu:
Click , and then click Cell .
Handheld: Press h
.
The VarLink menu is displayed.
3.
Under
Link To
, scroll to the name of the variable and click it.
The cell shows the value of the variable.
Using a Variable in a Calculation
After storing a value in a variable, you can use the variable name in an expression as a substitute for the stored value.
1.
Enter the expression:
Type 4*25*num^2 on the entry line, and press
Enter
.
Handheld: Type 4 r
25
r
num^2
on the entry line, and press
·
.
Calculator substitutes 517, the value currently assigned to
num
, and evaluates the expression.
2.
Enter the expression:
Type 4*25*nonum^2, and press Enter .
Handheld: Type 4 r
25
r
nonum^2
on the entry line, and press
·
.
236 Using Variables
CAS: Because the variable
nonum
has not been defined, it is treated algebraically in the result.
Because the variable
nonum
has not been defined, the expression returns an error message.
Entering Multiple Statements on the Entry Line
To enter several statements on a single line, separate them with a colon (“:”).
Only the result of the last expression is shown.
Setting Variable Values with a Slider
In the Graphs and Geometry applications, a slider control lets you adjust or animate the assignment of values for a numeric variable. Use a slider to represent multiple variable values in a continuous range.
1.
From the Document Tools menu, click
Actions > Insert Slider
.
Handheld: Press b 1
A to insert a slider.
The slider is displayed on the work area. If you need to adjust or animate value selection for more than one variable, you can repeat this step and insert multiple sliders.
Note:
You can access the context menu to Pin a slider to its location and prevent unintentional movement.
2.
Click the slider to activate it and press e to move between the slider scale and the variable’s value.
3.
Use
¡ and
¢ to move the slider on the scale.
4.
Press Enter to select the value.
Using Variables 237
Access the context menu and choose
Settings to view or change the default slider settings.
Naming Variables
Variable and function names that you create must meet the following naming rules.
Note:
In the unlikely event that you create a variable with the same name as one used for statistical analysis or by the Finance Solver, an error condition could occur. If you begin entering a variable name that is already in use in the current problem, the software shows the entry in bold to let you know.
• Variable names must be in one of the forms
xxx
or
xxx.yyy
. The
xxx
part can have 1 to 16 characters. The
yyy
part, if used, can have 1 to 15 characters. If you use the
xxx.yyy
form, both
xxx
and
yyy
are required; you cannot start or end a variable name with a period “.”.
• Characters can consist of letters, digits, and the underscore character (_).
Letters can be U.S. or Greek letters (but not
Π or p), accented letters, and international letters.
• Do not use c or n from the symbol palette to construct a variable name such as c1 or n12 . These may appear to be letters, but they are treated internally as special symbols.
• You can use uppercase or lowercase letters. The names
AB22
,
Ab22
,
aB22
, and
ab22
all refer to the same variable.
• You cannot use a digit as the first character of
xxx
or
yyy
.
• You can use digits 0 through 9, U.S. letters, a - z, Latin and Greek letters
(but not p) as subscripts (for example,
a
2
, q a
, or h
2 o
). To enter a subscript while typing a variable name, select in the Math Templates or on the formatting toolbar.
• Do not use spaces.
• If you want a variable to be treated as a complex number, use an underscore as the last character of the name.
• CAS: If you want a variable to be treated as a type of unit (such as
_m
or
_ ft
), use an underscore as the first character of the name. You cannot use subsequent underscores in the name.
• You cannot use an underscore as the first character of the name.
238 Using Variables
• You cannot use a preassigned variable, function, or command name, such as
Ans
, min
, or tan
.
Note:
For more information about TI-Nspire™ functions, see the Reference
Guide.
• Library documents and library objects are subject to additional naming restrictions. For more information, see
Libraries.
Here are some examples:
Variable names
Myvar, my.var
Valid?
Yes
No. Contains a space.
My var, list 1 a, b, b12, b
Log,
Ans
12
, c, d
Yes. Note that variables b12 and b
12 are distinct.
No. Preassigned to a system function or variable.
Log1, list1.a, list1.b
Yes
3rdTotal, list1.1
No.
xxx
or
yyy
starts with a digit.
Locking and Unlocking Variables
Locking lets you protect variables from modification or deletion. Locking prevents unintended changes to a variable.
Time and altitude lists can be locked to ensure problem fidelity.
Using Variables 239
Reference function f1 can be locked to prevent unintended change.
Variables you Cannot Lock
• System variable
Ans
•
stat.
and
tvm.
variable groups
Important Information About Locked Variables
• To lock variables, use the Lock command.
• To modify or delete a locked variable, you must first unlock the item.
• Locked variables display a lock icon on the variable menu list.
• The Lock command clears the Redo/Undo history when applied to unlocked variables.
Examples of Locking
Lock a,b,c
Lock mystats
.
Locks variables
a
,
b
, and
c
from the Calculator application.
Locks all members of variable group
mystats
.
UnLock func2
Unlocks variable func2.
lm:=getLockInfo
(var2)
Retrieves the current lock status of
var2
and assigns that value to
lm
in the Calculator application.
For more information, see the Reference Guide.
Updating a Variable
If you want to update a variable with the result of a calculation, you must store the result explicitly.
240 Using Variables
Entry
a := 2 a
3
a a := a
3
a a
2
&
a a
2
8
Result Comment
2
8 Result not stored in variable
a
.
Variable result.
a
updated with
8
64
Variable result.
a
updated with
64
Reusing the Last Answer
Each instance of Calculator automatically stores the last calculated result as a variable named Ans. You can use Ans to create a chain of calculations.
Note:
Do not link to Ans or any system variable. Doing so could prevent the variable from being updated by the system. System variables include statistics results (such as
Stat.RegEqn
,
Stat.dfError
, and
Stat.Resid
) and Finance Solver variables (such as
tvm.n
,
tvm.pmt
, and
tvm.fv
).
As an example of using Ans, calculate the area of a garden plot that is 1.7
meters by 4.2 meters. Then use the area to calculate the yield per square meter if the plot produces a total of 147 tomatoes.
1.
Calculate the area:
On the Calculator entry line, type 1.7*4.2, and press Enter .
Handheld: On the Calculator entry line, type 1.7 r
4.2
, and press
·
.
2.
Reuse the last answer to calculate the yield per square meter:
Type 147/ans and press
Enter to find the yield.
Handheld: Type 147 p
ans
, and press
· to find the yield.
Using Variables 241
3.
As a second example, calculate and then add 2*log(45).
Type 3.76/(-7.9+sqrt(5)), and press
Enter
.
Handheld: Type 3.76 p
(
v
7.9+sqrt(5))
, and press
·
.
4.
Reuse the last answer:
Type ans+2*log(45), and press Enter .
Handheld: Type ans+2 r
log(45)
, and press
·
.
Temporarily Substituting a Value for a Variable
Use the “|” (such that) operator to assign a value to a variable for just a single execution of the expression.
Removing a Linked Variable
1.
Select the linked variable.
2.
Press h
.
The Variables options are displayed.
3.
Select
Unlink
.
The link is removed from the value, and the value is displayed without any bold formatting.
242 Using Variables
Download
Advertisement
Key features
Handheld emulation
Document creation/editing
Lesson presentation tools
Student assessment
File management
Web content access
Frequently asked questions
Click File > Settings > Change Language. Select your preferred language and restart the software.
Use the Content Workspace to locate files on your computer, network drives, external drives, and web content.
Use the Content Workspace to transfer documents, folders, or OS files to connected handhelds.