Pergunta

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?

Foi útil?

Solução

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

Outras dicas

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

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');

"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/

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top