Is there a way to search for function calls recursively without running the program?
5 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Rik
2022 年 2 月 24 日
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.
回答 (2 件)
Steven Lord
2022 年 2 月 28 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!