
calling mex file with multiple entry point functions within it
10 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying to use mex file to speed up execution of my code.
Specifically, I used the matlab coder to convert the matlab function into the mex file.
Then, I called this mex file in my matlab code as following.
[EMAX_1, EMAX_2] = EMAX_solve_andrew_mex(temp_params,d,X0(k),E0(k),num_y(1+(k-1)*15:(k)*15));
However, when I try to call this mex file, I get following errors.
"Entry-point function name not specified. When calling MEX functions that have multiple entry-point functions,
the first argument must be the name of the entry-point function to call. Follow this argument with the arguments that the named entry-point function requires."
I think the problem is that there are 2 functions inside of the EMAX_solve_andrew (which are "utility_andrew" and "log_wage_andrew", which I included as entry-point functions when I convert EMAX_solve_andrew.
Can you please help me how to solve this issue? I tried to use mexfilename function as explained from following site, but was not able to follow it.
https://www.mathworks.com/matlabcentral/answers/343776-how-do-i-use-a-mex-file-generated-from-matlab-coder-project-that-contains-multiple-entry-point-funct
Thank you.
P.S. codegen folder is also created in the same folder.
0 个评论
回答(1 个)
Anshika Chaurasia
2020-12-29
编辑:Anshika Chaurasia
2020-12-29
Hi Dohun,
It is my understanding that you have generated EMAX_solve_andrew_mex that has entry point functions utility_andrew and log_wage_andrew.
Let's consider the MEX function, mySharedMex, that has entry-point functions ep1 and ep2.
To call ep1 with an input parameter u, enter:
mySharedMex('ep1',u) % mex_file('entry_point_function',parameters)
To call ep2 with input parameters v and x, enter:
mySharedMex('ep2',v,x)
If you don't pass entry-point function name like:
mySharedMex(u)
You will get error:

0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Code Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!