Number of input arguments you supply to the function that calls arginnum. c is an integer.
You can use arginnum to determine if the number of inputs you supply to a function is less than the maximum number of inputs for that function. You then can assign default values to define the optional inputs, or you can use the error function to return an appropriate error message. If you attempt to call arginnum outside of a user-defined function, MathScript always returns 0.
Copy the following script into a new MathScript inside your project. The script uses arginnum to determine if the number of inputs you supply to integerdivision is less than 2. The script then assigns a default value of 1 to the divisor input.
function [quotient, remainder] = integerdivision(dividend, divisor)
%This is an example for using arginnum and argoutnum.
divisor = 1
quotient = floor(dividend / divisor)
remainder = rem(dividend, divisor)
After you copy the script into your project, call the following commands in the MathScript node.