MEX-equivalent of INPUTNAME
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
All,
Is there a way, within a mexFunction, of retrieving the actual name of (the caller's) argument passed as one of the prhs parameters? Or, in other words, is there a way in MEX to do the equivalent of the inputname function as in
function f(a)
fprintf('Formal parameter ''a'' is called ''%s''\n', ...
inputname(1))
end
0 Kommentare
Akzeptierte Antwort
Kaustubha Govind
am 10 Nov. 2011
I don't think there is a MEX-API function that is the equivalent, but you can always use mexCallMATLAB to dispatch the call to MATLAB itself.
7 Kommentare
Kaustubha Govind
am 11 Nov. 2011
This solution has an attached example where a function handle is passed into a MEX-function, which is then evaluated using mexCallMATLAB and feval: http://www.mathworks.com/support/solutions/en/data/1-9RKXIN/index.html - I believe this is what Jan is suggesting.
Weitere Antworten (1)
Jan
am 10 Nov. 2011
You can use mexCallMATLAB to call FEVAL with the function handle as argument.
Perhaps somebody knows how to use mxFevalFunctionHandle?
Siehe auch
Kategorien
Mehr zu Write C Functions Callable from MATLAB (MEX Files) finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!