Is there a way to search for function calls recursively without running the program?
Mostrar comentarios más antiguos
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 comentarios
Rik
el 24 de Feb. de 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.
Kyle Padilla
el 28 de Feb. de 2022
Respuestas (2)
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
Matt J
el 18 de Feb. de 2022
0 votos
Perhaps this will be of some help,
3 comentarios
Kyle Padilla
el 24 de Feb. de 2022
Matt J
el 25 de Feb. de 2022
I was hoping for something more focused on functions specifically,
Isn't that the case with the tools I mentioned?
Kyle Padilla
el 28 de Feb. de 2022
Categorías
Más información sobre Software Development en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!