Matlab C Library Call Matlab Built-In Functions

本文详细介绍了mexCallMATLAB函数的使用方法及参数说明。该函数用于从MEX文件中调用MATLAB内置函数、操作符、M文件或MEX文件。文中解释了输入输出参数的意义,并说明了如何通过此函数实现与MATLAB环境的交互。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原文:http://note.sonots.com/Mex/Builtin.html

Syntax 

#include "mex.h"
int mexCallMATLAB(int nlhs, mxArray *plhs[], int nrhs,
 mxArray *prhs[], const char *name);

Arguments 

nlhs
Number of desired output arguments. This value must be less than or equal to 50.
plhs
Array of pointers to mxArrays. The called command puts pointers to the resultant mxArrays into plhs and allocates dynamic memory to store the resultant mxArrays. By default, MATLAB automatically deallocates this dynamic memory when you clear the MEX-file. However, if heap space is at a premium, you may want to call mxDestroyArray as soon as you are finished with the mxArrays that plhs points to.
nrhs
Number of input arguments. This value must be less than or equal to 50.
prhs
Array of pointers to input arguments.
name
Character string containing the name of the MATLAB built-in, operator, M-file, or MEX-file that you are calling. If name is an operator, just place the operator inside a pair of single quotes, for example, '+'.

Returns 

0 if successful, and a nonzero value if unsuccessful.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值