ParseToFunction Command

ParseToFunction( <Text> )

Parses the text containing the function definition and creates the corresponding function.

  • ParseToFunction("x^2") creates the function f(x) = x2.

  • ParseToFunction("t+2/t"}) creates the function f(t) = t + 2/t.

ParseToFunction( <Function>, <Text> )

Parses the string and stores the result to a function f, which must be defined and free before the command is used.

Define f(x) = 3x² + 2 and text1 = "f(x) = 3x + 1". ParseToFunction(f, text1) returns f(x) = 3x +1.

ParseToFunction( <Text>, <List of variables> )

Parses the text containing the function definition and creates the corresponding function of the variables defined in the list.

ParseToFunction("2u+3v",{"u", "v"}) creates the function a(u,v) = 2u + 3v.

See also ParseToNumber command.