This is an old revision of the document!
Use Table → Set Column Formula menu item to open column formula dialog window.
See formula syntax.
i contains the current row index.
Rows are always evaluated one after another from the first to the last in range which was specified in 'Set Column Formula' window. Accordingly the row number
i is incremented on each step.
You can use this behaviour to calculate factorial: set
1 in the first row of column
A and after that set formula
cell(A, i-1) * i and rows interval from
100. Note that formula is to be set for rows beginning from the second, and not from the first. You will get the factorial of row number (
Only in Set Column Formula window.
There are two functions to obtain current table cell values in formula:
col(A)– returns the value of cell in column 'A' in the current (i-th) row. Equivalent to
cell(A, 3)– returns the value in column
You can use either upper-case letters (
col(B)) or numbers (
1, 2, 3,.., e.g.
col(1)) in columns numeration in arguments of
col(A) + 15 + cell(B, i+1)
Some mathematical functions can be defined only on a certain interval. For example, square root (
sqrt(x)) is not defined for negative numbers (all calculations in MagicPlot are made in real numbers, not complex). Hence if the argument of
sqrt is negative, a Not-a-Number (NaN) is returned. If a NaN value occurs in some part of formula, the result of calculation will also be a NaN, and corresponding table cells will be empty.
The calculations are not terminated if NaN value occurs in some row(s).
In some cases you may want to check if a
NaN values occurs in calculations. MagicPlot shows the warning “Not-a-Number returned at row #”. This row number is the first row in which
NaN value was returned. MagicPlot also highlights the function or operator which first produces NaN value.