Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

how to display the name of an input function by a function functions?

1 Ansicht (letzte 30 Tage)
Mr M.
Mr M. am 8 Mär. 2016
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I would like to write a function functions ff and run this way: ff(@inputfunc) which prints the name of the input function, in this case "inputfunc". How to do that?

Antworten (2)

Matthew Eicholtz
Matthew Eicholtz am 8 Mär. 2016
I am slightly confused by the wording of your question ("function functions ff"?), but I have a feeling that mfilename may be a good starting point.
You can use mfilename inside of a function to get the name of the currently executing function.
Does this help at all?

Fangjun Jiang
Fangjun Jiang am 8 Mär. 2016
fhandle=@sin;
func2str(fhandle)
ans =
sin

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by