assist 发表于 2006-4-15 15:28

[求助]nargout,改写成多少??????

<P>/*<BR> The most generic MATLAB M-function is function = foo(X1, X2, ..., varargin)<BR>This function maps directly to the following IDL signature. <BR>HRESULT foo( long nargout,<BR>             VARIANT* Y1,<BR>             VARIANT* Y2,<BR>            .<BR>             VARIANT* varargout,<BR>             VARIANT X1,<BR>             VARIANT X2,<BR>            .<BR>             VARIANT varargin);<BR>This IDL function definition is generated by producing a function with the same name as the original M-function and<BR>an argument list containing all inputs and outputs of the original plus one additional parameter, nargout. (nargout <BR>is not produced if you compile an M-function containing no outputs.) When present, </P>
<P>the nargout parameter is an parameter of type long.It is always the first argument in the list. </P>
<P>This parameter allows correct passage of the MATLAB nargout parameter to the compiled M-code. </P>
<P>Following the nargout parameter, the outputs are listed in the order they appear <BR>on the left side of the MATLAB function, and are tagged as , meaning that they are passed in both directions. The <BR>function inputs are listed next, appearing in the same order as they do on the right side of the original function. All <BR>inputs are tagged as parameters. When present, the optional varargin/varargout parameters are always listed as the <BR>last input parameters and the last output parameters. All parameters other than nargout are passed as COM VARIANT types. <BR>Data Conversion Rules lists the rules for conversion between MATLAB arrays and COM VARIANTs.<BR> */<BR><BR>以上提供的是关于matlab转换成com组件后,再调用时,如果原函数有返回值,则必有nargout是long类型的,我现在调用情况是这样的,有一个输入矩阵7*6的,一个输出矩阵—*3的,请问nargout应该写成多少?是1,还是21还是42还是63?????<BR>帮我忙顶顶!</P>

zjliu 发表于 2006-4-15 18:24

自定义的函数一般可以确定它的输出参数个数,所以可以不使用nargout

assist 发表于 2006-4-16 08:55

<P>能否给个实例看看阿。兄弟。nargout,如果不是自定义的函数,那么他应该怎么写,自定义的如果不使用nargout<BR>,那么是否应该写成0。</P>
页: [1]
查看完整版本: [求助]nargout,改写成多少??????