Difference between revisions of "ParseToFunction Command"
From GeoGebra Manual
m |
m |
||
Line 1: | Line 1: | ||
− | <noinclude>{{Manual Page|version=5.0}}</noinclude> | + | <noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|scripting}} |
− | {{command|scripting}} | ||
;ParseToFunction[ <Function>, <String> ] | ;ParseToFunction[ <Function>, <String> ] | ||
:Parses the string and stores the result to a [[Functions|function]] ''f'', which must be defined and [[Free, Dependent and Auxiliary Objects|free]] before the command is used. | :Parses the string and stores the result to a [[Functions|function]] ''f'', which must be defined and [[Free, Dependent and Auxiliary Objects|free]] before the command is used. | ||
:{{example|1=Define <code><nowiki> f(x) = 3x² + 2</nowiki></code> and <code><nowiki> text1 = "f(x) = 3x + 1"</nowiki></code>. <code><nowiki> ParseToFunction[f, text1]</nowiki></code> returns ''f(x) = 3x + 1''.}} | :{{example|1=Define <code><nowiki> f(x) = 3x² + 2</nowiki></code> and <code><nowiki> text1 = "f(x) = 3x + 1"</nowiki></code>. <code><nowiki> ParseToFunction[f, text1]</nowiki></code> returns ''f(x) = 3x + 1''.}} | ||
{{note|1=See also [[ParseToNumber Command|ParseToNumber]] command. }} | {{note|1=See also [[ParseToNumber Command|ParseToNumber]] command. }} |
Revision as of 15:50, 6 August 2015
- ParseToFunction[ <Function>, <String> ]
- Parses the string and stores the result to a function f, which must be defined and free before the command is used.
- Example: Define
f(x) = 3x² + 2
andtext1 = "f(x) = 3x + 1"
.ParseToFunction[f, text1]
returns f(x) = 3x + 1.
Note: See also ParseToNumber command.