how do I find where a function is defined (equivalent of "which" command in bash)
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
PeterB
am 14 Jul. 2021
Bearbeitet: PeterB
am 14 Jul. 2021
When I start Matlab on one of my work machines, I get the message:
"Warning: Function count has the same name as a MATLAB builtin.."
I know exactly what the message means, but I do not know how to fix it, because I can not find where I have defined the function "count". If this was in a bash shell I would type the command "which count". Is there a Matlab equivalent, which shows me where the function "count" has been redefined?
1 Kommentar
Akzeptierte Antwort
Cris LaPierre
am 14 Jul. 2021
Bearbeitet: Cris LaPierre
am 14 Jul. 2021
Yes, there is a which command in MATLAB. Note that count is an overloaded function, meaning it exists in several toolboxes. Here are the results in R2021a.
which -all count
3 Kommentare
Walter Roberson
am 14 Jul. 2021
Yes, the user will always see that message on startup.
C:\Program Files\MATLAB\R2020a\toolbox\local\count.m
What is the point of that? It is shadowed with the current path settings, so it will not be invoked -- the strfun\count version will be invoked for datatypes other than the ones listed as having @ .
If the intent is to have it be active only for a particular data type, you should build it into the class for that datatype.
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Historical Contests finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!