Function: math[fnvals] - creates a value table of a function in one real

Calling Sequence:

fnvals(f, L);
fnvals(f, L, 'flag');

Parameters:

f - any expression in one real or the name (or a combination of names) of a function

L - a list of values or a vector

'flag' - the name

Description:

fnvals prints a table of function values by applying a function f to each element in L = [ [Maple Math] , ..., [Maple Math] ].

1) If f is a term then in the first form, fnvals prints the name `fn` and a column vector L on the left-hand side, and the corresponding function values as another column vector [f( [Maple Math] ), f( [Maple Math] ), ..., f( [Maple Math] )] on the right-hand side of an equation.

2) If f is a term then in the second form, fnvals substitutes each occurrence of the indeterminate in f with the column vector L, prints the converted term on the left-hand side and the corresponding function values as a column vector on the right-hand side of an equation.

3) If f is a function name or a combination of function names (including composita) then in the first form, fnvals behaves like described in 1), but prints the name f instead of `fn`.

4) If f is a function name or a combination of function names (including composita) then in the second form, fnvals behaves like described in 2).

Note that column vectors are only used to improve formatting, i.e. to compare the arguments of a function with the corresponding function values.

The result of fnvals is always NULL.

fnvals internally uses print/vector in order to display vectors vertically. After printing the table, vector display is reset to the value of _MathVector as it was before fnvals has been called.

This function is part of the math package, and so can be used only after performing the command with(math) or with(math, fnvals).

Examples:

> with(math):

> fnvals(x^2, [seqby(x, x=1 .. 2, 1/4)]);

[Maple Math]

> fnvals(x^2+x+1, [seqby(x, x=1 .. 2, 1/4)], 'flag');

[Maple Math]

> f := x -> x^2:

> g := x -> ln(x+1):

> fnvals(f, [1, 2, 3]);

[Maple Math]

> fnvals(f@g, [1., 2., 3., 4.]);

[Maple Math]

> fnvals(f*g, [1, 2, 3], 'flag');

[Maple Math]

> v := V(a, b, c);

[Maple Math]

> fnvals(x^2, v, flag);

[Maple Math]

> linalg[multiply](v, v);

[Maple Math]

> map(x -> x^2, v);

[Maple Math]

See Also:

print/vector .

Version History:

Version 1.0 - March 14, 1998