calling 2 custom function of the same name
1 次查看(过去 30 天)
显示 更早的评论
I'd like to know if there is simple way to calling 2 custom functions of the same name. I have one MEX function, and now I need add the new functionality to it, but I do not want to touch any of the existing MEX function, and the interface to all the other users. I just want to write the same name function, add the new functionality, and than call the existing function. I'd like to know if there is any simple way to do it? Thanks.
Julia
0 个评论
采纳的回答
Walter Roberson
2011-3-17
Put the new interface in to directory that appears first on the path. Have the new interface loadlib() the previous instance and call it.
6 个评论
Walter Roberson
2011-3-18
You have to create an appropriate .h file to match it, if you want to use loadlib() . You must already know the calling sequence in order to be able to call it without your addition -- or you must at least be able to reverse-engineer the calling sequence by knowing the standard mechanisms that Matlab uses when calling a mex routine.
You indicate that you do not want to touch the existing mex file, but do you have the source for it? If you do, then you can easily extract the calling sequence from there, and fairly readily build a .h file if you need it.
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!