MathScript is a text-based language equipped with a various number of built-in functions for performing mathematical, analysis, and signal processing calculations. Use the MathScript Node to write and execute MathScript code. You can also write user-defined functions in MathScript.
The following image shows an example of MathScript code.
- Wire—Data from your graphical program flows into input terminals that you create on the MathScript Node. To add an input terminal, right-click the node frame and select Create Input.
- Input terminal/Name of input terminal—To use the data from input terminals in the MathScript Node, refer to them by name in your code.
- Function—Enter the name of a built-in or user-defined function, followed by any inputs. Press Ctrl-Space inside the node to get an overview of all available functions.
- Output terminal/Name of output terminal—Assign the results of MathScript calculations to a new variable within the textual code. To use the value of this variable outside the MathScript Node, add an output terminal by right-clicking the node frame and selecting Create Output.
- Output values—You can use the values of the MathScript Node outputs in the rest of your graphical program.