Defining 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 include the:
• | Area of a rectangle |
• | Radius of a circle |
• | Value contained in a spreadsheet cell |
• | Contents of a row or column in a spreadsheet |
• | Function expression |
When you create a variable, it is stored in memory.
Types of Variables
You can store the data types listed in the following table as variables.
Data type |
Examples |
||||
---|---|---|---|---|---|
Expression |
2.54 |
1.25E6 |
2p |
(x-2)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 |