sub#
Substitute a value or expression for a variable.
Available in: math cells, REPL.
Syntax#
sub(expression, variable, value)
Arguments and behavior#
Pass an expression, variable and replacement expression/value. The result is displayed symbolic text or a numeric value. The example returns scalar (number).
Example#
Edit the inputs, then use Run or Reset. Changes stay in this example.
Example
sub("x^2+1","x",3)Interactive examples could not load. You can still copy the expressions.
Expected result: 10.