声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2558|回复: 2

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

[复制链接]
发表于 2006-4-15 15:28 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
<P>/*<BR> The most generic MATLAB M-function is function [Y1, Y2, ..., varargout] = foo(X1, X2, ..., varargin)<BR>This function maps directly to the following IDL signature. <BR>HRESULT foo([in] long nargout,<BR>            [in,out] VARIANT* Y1,<BR>            [in,out] VARIANT* Y2,<BR>            .<BR>            [in,out] VARIANT* varargout,<BR>            [in] VARIANT X1,<BR>            [in] VARIANT X2,<BR>            .<BR>            [in] 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 [in] 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 [in,out], 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 [in] 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>
回复
分享到:

使用道具 举报

发表于 2006-4-15 18:24 | 显示全部楼层
自定义的函数一般可以确定它的输出参数个数,所以可以不使用nargout
 楼主| 发表于 2006-4-16 08:55 | 显示全部楼层
<P>能否给个实例看看阿。兄弟。nargout,如果不是自定义的函数,那么他应该怎么写,自定义的如果不使用nargout<BR>,那么是否应该写成0。</P>
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-10-4 21:27 , Processed in 0.058928 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表