finding a phrase in a modularized code with over 1000 functions
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
Hi All,
I am seeking to be able to find a phrase, say 'XXXX' among a master script that calls some 1000 other functions. The functions are all in a directory with many subfolders as well.
I am hoping there is a way to do this withuot having to open each of the functions individually and then doing a search.
Much thanks,
Rand.
댓글 수: 0
답변 (3개)
Ameer Hamza
2020년 10월 12일
편집: Ameer Hamza
2020년 10월 12일
0 개 추천
You can use dir(): https://www.mathworks.com/help/matlab/ref/dir.html to get a list of all files. Use a loop to iterate over them and use strfind(): https://www.mathworks.com/help/matlab/ref/strfind.html or regexp(): https://www.mathworks.com/help/matlab/ref/regexp.html to search the string in the file.
댓글 수: 1
Rand Dannenberg
2020년 10월 12일
Rik
2020년 10월 12일
0 개 추천
You can use Matlab tools, as Ameer describes, but you can also use external software. I personally find the performance of searches like this excellent when I use Notepad++. You can use normal searches and regular expression. You can also filter the file type and search a single folder or include all subdirectories.
댓글 수: 0
Steven Lord
2020년 10월 12일
0 개 추천
You can use the Find Files tool in the File section of the Home tab of the toolstrip.
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!