Create user-defined MathScript functions to separate recurrent calculations from the main program in a MathScript Node.
User-defined functions usually contain one special function and must have a function definition. If you open a new script document, MathScript displays the code function func() by default. The variables you use in user-defined functions are local variables.
Use the MathScript workspace for writing and editing user-defined functions. User-defined functions have the lowercase file extension .m.