嘿,假设我有一个名为'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.
更多推荐
发布评论