Table of values and graph : tablefunc and plotfunc

### 4.17.4 Table of values and graph : tablefunc and plotfunc

tablefunc is a special command that should be run from inside the spreadsheet. It returns the evaluation of an expression ex depending on a variable x for x=x0, x0+h,.... :

tablefunc(ex,x,x_0,h) or tablefunc(ex,x)

In the latter case, the default value for x0 is the default minimum value of x from the graphic configuration and the default value for the step h is 0.1 times the difference between the default maximum and minimum values of x (from the graphic configuration).
Example: type Alt+t to open a spreadsheet if none are open. Then select a cell of the spreadsheet (for example C0) and to get the table of "sinus", input in the command line of the spreadsheet :

tablefunc(sin(x),x)

This will fill two columns with the numeric value of x and sin(x) :

- in the first column the variable x, the value of the step h (1.0), the minimum value of x (-5.0), then a formula, for example =C2+C$1, and the remaining rows of the column is filled by pasting this formula.
- in the next column the function sin(x), the word "Tablefunc", a formula, for example =evalf(subst(D$0,C$0,C2)), and the remaining rows of the column are filled by pasting this formula.

Hence the values of sin(x) are on the same rows as the values of x. Note that the step and begin value and the expression may be easily changed by modifying the correspondent cell.

The graphic representation may be plotted with the plotfunc command (see 5.2.1).