How I'm able to search for a variable in different functions and scripts?
Show older comments
I'm looking for a function or tool which help me to find the usage of a variable in different scripts or functions with just one click.
4 Comments
"with just one click". As far as I know, you may have to write this tool yourself as none exist.
Note that this tool may have to probe the author's / user's brain, since matlab has no way of knowing if variable a in script1 is the same as variable a in script2.
John D'Errico
on 31 Aug 2016
Edited: John D'Errico
on 31 Aug 2016
Well, actually, I did post mgrep many years ago. It does not work with just one click though. I'm not sure there is a simple solution that works on JUST one click. And as far as reading your mind, that is hard to do.
Reinhard Palaver
on 31 Aug 2016
Guillaume
on 31 Aug 2016
Well, all these tools will certainly find a string in several files. However, it is a far cry from finding "the usage of a variable in different scripts or functions". This would require some semantic analysis. Even then, I'm not sure that such a tool could be made for matlab (unlike other languages such as C), particularly for scripts since there isn't an absolute way to connect them.
Answers (1)
MATLAB finds any string in any text files (not quite one button click):
- Ribbon: "Home" tab -> "Find Files".
Have you tried using that ?
3 Comments
Reinhard Palaver
on 31 Aug 2016
Reinhard Palaver
on 1 Sep 2016
Edited: Reinhard Palaver
on 1 Sep 2016
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!