Graph IDE ► Controls ► Formula Selector
The Formula Selector computes a sequence of values for a Spreadsheet and Tables column. It is important to note that a formula is a quick way to populate a column of values and that once populated then each table cell entry can be further modified.
For making more general algorithms see Programming.
Formula Selector
The Formula Selector is brought forward by selecting the "Formula" entry to the Component drop down. The Component drop down is brought forward by right-mouse-click or select-hold on a table column header or by using the Component drop down menu near the table. The Formula Selector is annotated below.
Number Of Rows : The number of times that the formula is computed. Upon each execution the domain index ('i' which represents the row index of a column in a table) is incremented by one.
Examples : Gives a menu of possible formula entries. Select a menu item to load that entry. The last entry in the menu is "Revert to formatter settings" and if selected loads the formula last stored in a Spreadsheet column.
Formula : A formula that uses the symbol 'i' as its domain and utilizes the Programming facilities to compute new range values. The current range of the row is represented by the symbol 'v'. A formula is a single statement program.
Prefix : The prefix to the range of the formula. If the table column is numeric only type then the prefix is not available.
Suffix : The suffix to the range of the formula. If the table column is numeric only type then the suffix is not available.
Compute : Once all parameters have been entered then select the Compute button to perform the formula mapping and enter all values into the selected table column.
Formula Examples
Example formulas are shown in the table below. For language syntax and predefined function declarations see Language.
Formula | Description |
i | Fill with row index 1 to 'N'. Notice that the domain variable begins at 1 and increments by 1 to the value of 'N' |
-v | Reverse the sign of the current values. This is short for -1 * v. |
2 * v | Double current values. Any algebraic formula can be used so that the formula can be quite complex. Use the normal parenthesis to define precedence of operation. |
floor(v * 100 + 0.5)/100 | Round current values to two decimal places. floor() means make its argument a whole number by truncation. The function ceil() means make its argument a whole number by increasing to the next whole number. To be explicit, making a whole number from a real number has two operators instead of the normal one. |
i % 2 | Alternate between 1 and 0. The percentage symbol is the modulus operator. |
1 | Fill with the constant 1. Any constant number can be used. |
sin((i - 1.0) * 0.1) | Fill with a modulated signal. The Language section list all available functions. |
NAN | Invalidates all rows. Note that NAN must be all capitals to be interpreted as the "Not a Number" entry. This is in opposition to entering NaN into a table cell as that is case insensitive. |
Note that the symbol 'v' is the current value of the table row and must be a numeric value in order for the formula to be valid. If the table column is not of a numeric type then 'v' can not be used.
Here are a few ideas: