Is there a way to search for function calls recursively without running the program?
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Rik
am 24 Feb. 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.
Antworten (2)
Steven Lord
am 28 Feb. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Performance and Memory 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!