Table Of Contents

Introduction to User-Defined Functions

Last Modified: January 2, 2017

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.


You can use MathScripts without a function definition to test a sequence of commands.

Recently Viewed Topics