将mex函数调用限制在matlab中的m文件中(Limit mex

编程入门 行业动态 更新时间:2024-10-22 18:46:44
将mex函数调用限制在matlab中的m文件中(Limit mex-function call to m-file in matlab)

嘿,假设我有一个名为'myMx'的编译mex文件,有没有办法禁止直接调用myMx()? 我只希望将myMx()从我的m文件函数callMyMx()中调出,因为这是我在其中进行额外的输入参数检查的地方,所以我不必在mex文件本身中执行此操作。 谢谢!

Hey there, assuming I have a compiled mex file with the name 'myMx', is there any way to disallow direct calls to myMx()? I only want myMx() to be called out of my m-file function callMyMx() because that's where I do additional input-arguments checking so that I don't have to do it in the mex-file itself. Thanks!

最满意答案

为确保其他功能无法访问myMx ,您必须将其设置为专用功能 。 简而言之,您在callMyMx所在的目录中创建一个private的子目录,并将myMx那里。 这保证了只有callMyMx目录中的callMyMx才能看到myMx 。

To make sure that other functions cannot access myMx, you have to make it into a private function. Briefly, you create a subdirectory private in the directory in which callMyMx resides, and move myMx there. This guarantees that only functions in the directory of callMyMx can see myMx.

更多推荐

本文发布于:2023-08-04 08:35:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1413086.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   文件   mex   Limit   matlab

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!