evalin('caller','mfilename') does not work.
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
raym
el 12 de Mayo de 2019
Respondida: Walter Roberson
el 13 de Mayo de 2019
function out = cdc
out = evalin('caller','mfilename');
end
This fucntion returns the 'cdc', not the caller's mfilename.
2 comentarios
Rik
el 12 de Mayo de 2019
Why don't you use mfilename directly in the caller? Alternatively you can do something similar with dbstack.
Más respuestas (1)
Walter Roberson
el 13 de Mayo de 2019
"evalin('caller', expression) finds only variables in the caller's workspace; it does not find functions in the caller. For this reason, you cannot use evalin to construct a handle to a function that is defined in the caller."
If I recall correctly mfilename is implemented by defining a function in each file.
0 comentarios
Ver también
Categorías
Más información sobre Simulink Functions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!