Table Of Contents

argoutnum

Version:
    Last Modified: March 15, 2017

    Returns the number of output arguments you request from the function that calls argoutnum.

    Syntax

    c = argoutnum
    Legacy name: nargout

    Outputs

    c

    Number of output arguments you request from the function that calls argoutnum. c is an integer.

    Usage

    You can use argoutnum to determine if the number of outputs you request from a function is less than the maximum number of outputs for that function. You then can bypass the calculation of the unrequested outputs. If you attempt to call argoutnum outside of a user-defined function, MathScript always returns 0.

    Copy the following script into a new MathScript inside your project. The script uses argoutnum to determine if the number of outputs you request from integerdivision is greater than 1.

    function [quotient, remainder] = integerdivision(dividend, divisor)
    %This is an example for using arginnum and argoutnum.
         if arginnum<2
              divisor = 1
         end
    quotient = floor(dividend / divisor)
         if argoutnum>1
              remainder = rem(dividend, divisor)
         end

    After you copy the script into your project, call the following commands in the MathScript node.

    [x, y] = integerdivision(14, 3)
    [x] = integerdivision(14, 3)
    integerdivision(14, 3)

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics