Is there a way to search for function calls recursively without running the program?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
In Visual Studio, the "View Call Hierarchy" option allows you to see everywhere a function is called, where the caller is called, etc., all the way up the hierarchy. This can be done without running the program. Is there a way to do something like this in MATLAB? It seems like you either need to use the "Find Files" feature and manually follow the hierarchy or look at the call stack at run-time.
2 commentaires
Rik
le 24 Fév 2022
Matlab is very dynamic when it comes to functions vs variables. You might be able to borrow code from my minify function to automatically extract the names from every function that is called. With some calls to which you should be able to find the file locations of those functions.
The performance will probably be terrible, but it should (mostly) work. The tools linked on the page that Matt suggested might also help you create something.
Réponses (2)
Steven Lord
le 28 Fév 2022
Static analysis can only get you so far. What function gets called by these two lines of code (omitting the block comment lines) assuming userSpecifiedMatfile contains a MAT-file name?
%{
data = load(userSpecifiedMatfile);
plot(data.x)
%}
Which of the N functions named plot does that second line call?
which -all plot
0 commentaires
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!