Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matlab: how to find functions on path that use a given function

It sometimes happens that I need to change the behavior of a function. Is there an easy way to find functions (on the matlab path) that use that function?

like image 614
Alain Avatar asked Apr 13 '10 12:04

Alain


People also ask

How do you reference a function in MATLAB?

To call a function, we need to write in a line of code in the following order, output argument, followed by the “=” character, function name, and then the input arguments in parentheses.

How do I add a search path to MATLAB?

Add Folder to Search Path and Disable Folder Change Notification. Create the folder matlab/myfiles . Then, add it to the top of the search path, disable folder change notification, and return the search path before adding the folder. mkdir('matlab/myfiles') oldpath = addpath('matlab/myfiles','-frozen');

Can you call a function in a script MATLAB?

You call the function just like you would call it from the command line or from another function. There is no difference in the syntax. Are you trying to have the function code in the same file as the script code?


2 Answers

The way I do this is to look for files that contain the name of the function I'm interested in. Thus, I don't only see who calls my function, but also what signature they use.

In the editor: Edit->Find Files

like image 177
Jonas Avatar answered Nov 25 '22 14:11

Jonas


Start with help deprpt.

EDIT: when I run a dependency report there are 3 checkboxes at the top of the report window. One of these, by default unchecked, is called 'Show parent functions (current folder only)'. That is probably the beginning of what you want but it only works in a single folder.

If you want more than that, I suggest that you try edit deprpt.m.

like image 25
High Performance Mark Avatar answered Nov 25 '22 15:11

High Performance Mark