2

I would need to find all the places in my code (several M files in a folder) where I used a particular function (unique in this case).

Do you know if it is possible?

2

4 Answers 4

6

In Matlab, there is the command "Find Files" - in the "Edit" menu, or on the "Home" and "Editor" ribbon - that allows you to find files containing specific text, either in a folder or on the entire Matlab path:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

3

Use the "find in files" function in Notepad++

Comments

1

If you want to check what functions you're using, depfun allows you to do so, although it might be overkill if you only want to check for a single known function.

For example (checking functions called directly by a function only):

[list builtins] = depfun(fun, '-toponly');

Comments

0

"which" seems to do it.

Take a look at this: http://www.mathworks.co.uk/help/matlab/ref/which.html (1st example)

Otherwise, notepad++ allows you to search (and replace) multiple files for a text string, here's a simple tutorial: http://www.makeuseof.com/tag/how-to-find-and-replace-words-in-multiple-files/

1 Comment

which only allows you to find functions, not instances inside files where specific functions are called.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.