Table Of Contents

Testing MathScript Functions

Version:
    Last Modified: December 23, 2016

    Use the MathScript Console to quickly test a MathScript function without the overhead of adding a MathScript Node and inputs and outputs to a diagram.

    The following procedure demonstrates how to test a MathScript function in the MathScript Console using a specific example. The example calculates the product of a matrix. The steps you need to take to complete your specific task might be different than the following steps.

    1. Select View»More»Tools Launcher to open the Tools Launcher.
    2. Click MathScript Console to open the MathScript Console.
    3. Enter the following code in the command section of the MathScript Console window: A = [1+3i, 5.6; -2.3, 8-i];
      spd-note-note
      Note  

      Use a semicolon at the end of an assignment to avoid displaying the output in the command section.

    4. Press Enter. The workspace section of the MathScript Console displays the name, type, size, and values of array A.
    5. Use the arrow-up key to re-enter the code that you previously entered in the command section.
    6. Change the displayed code to B = [1-3i, 5.6; 2.3, 8+i];
    7. Press Enter. The workspace section of the MathScript Console displays the name, type, size, and values of array B.
    8. Enter the following code in the command section: C = multmx(A,B);
    9. Press Enter. The workspace section of the MathScript Console now displays the name, type, size, and values of the results array C.

    Recently Viewed Topics