필터 지우기
필터 지우기

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.

답변 (1개)

cr
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
cr
cr 2020년 11월 24일
That should be a lot easier on windows file search or macos finder search.
Rik
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 CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by