Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

argoutnum (MathScript RT Module Function)

LabVIEW 2011 MathScript RT Module Help

Edition Date: June 2011

Part Number: 373123B-01

»View Product Info

Owning Class: support

Requires: MathScript RT Module

Syntax

c = argoutnum

Legacy Name: nargout

Description

Returns the number of output arguments you request from the function that calls argoutnum. 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.

Examples

Outputs

Name Description
c Returns the number of output arguments you request from the function that calls argoutnum. c is an integer.

Details

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized

Examples

Save the following script as integerdivision.m in the LabVIEW Data directory. The script uses argoutnum to determine if the number of outputs you request from integerdivision is greater than 1. If you request less than two outputs from integerdivision, LabVIEW bypasses the calculation of the remainder output.

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 save integerdivision.m, call the following commands in the LabVIEW MathScript Window or the MathScript Node.

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

Related Topics

arginnum


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit