matlab - How to get function calling function from a MEX file -
I have a max function and I need to get the name of the function, which is called this mac function from malbase. What are the ways to do this? I have tried
mexCallMatlab (..., "dbstack") But, it gives an empty result, because it probably runs in the workspace goes .
Yes, I know that I can pass the name of the function directly in the form of an argument, but this is not an option for me.
"dbstack" calling should be used by using "maxcollmtl" from within the MEX function. Just be careful when changing the output of the string "DBSTAC", which is the MATLAB structure, should be careful. This is the CMEX code
# "mex.h" void mexfunction (ent NLHS, MXARRA * PLHS [], int NRHS, CONST MXERE * PHS []) {MXARE * MXARR [1] ; Max Callmetab (1, MXARR, 0, Faucet, "DB Stack"); Four * funcName = mxArrayToString (mxGetField (0x, 0, "name")); Printf ("Function's name =% s \ n", Fenkenname); } It calls the Max function the Max function.
function call memos () myMex (); When you run the "call memx" function, you should show the output:
function name = callmax
Comments
Post a Comment