Finding where a m file or a function is called in a folder with subfolders and many other m files?
7 ビュー (過去 30 日間)
古いコメントを表示
I have a 'xyz.m' file which contains a function with the same name, and I want to find where it has been called in a folder full of other m files. Can I do that easily and fast?Thanks a lot.
0 件のコメント
回答 (1 件)
cr
2020 年 11 月 23 日
If you mean which function is calling xyz.m, you can try adding the following line in xyz.m
evalin('caller','mfilename')
That should display the m file which called xyz()
5 件のコメント
Rik
2020 年 11 月 24 日
The OS tool will not be able to distinguish between comment and code. But it is a good idea to filter out files that don't contain the search string anyway, before parsing variable and function names.
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!