how can i know which toolbox a function is calling?

If I have a function, how can I know which toolbox is using without going through the code?
And also, how can I know which subfunctions a fucntion is calling?
I have used:
profile on
function()
profile viewer
but it looks really messy because it lists also all scripts and built-in
Thanks

 채택된 답변

Kelly Kearney
Kelly Kearney 2011년 11월 23일

1 개 추천

I prefer fdep over depfun, because a) it provides a lot more detailed information, including separating the files by toolbox if applicable, and b) I find depfun very buggy and unreliable (I get the same type of crashes you refer to, usually because depfun messed up and is trying to list every function and method associated with some random obscure class that is not actually called by my function but that shares a name with something in the dependency tree).

추가 답변 (4개)

Thomas
Thomas 2011년 11월 22일

4 개 추천

Use a 'which FucntionName' command
Eg.
>> which qfunc
/Applications/MATLAB_R2011b.app/toolbox/comm/comm/qfunc.m
Tells you that it is using the communication toolbox..

댓글 수: 5

joeDiHare
joeDiHare 2011년 11월 23일
no, 'which' does not tell me all the toolbox a function is using.
joeDiHare
joeDiHare 2011년 11월 23일
Well, true, you are right. Unfort I am looking for a non built-in.
Thanks ayway.
Thomas
Thomas 2011년 11월 23일
It will if you are asking for an inbuilt functions and wanted to know which toolbox the function belongs to.. :)
If you want tot know all the toolboxes a function is dependent on, try depfun() as mentioned by Fangjun.
More info on depfun(): http://www.mathworks.com/help/techdoc/ref/depfun.html
That is not necessarily true.
which max
will tell you:
built-in (/Applications/MATLAB_R2009b.app/toolbox/matlab/datafun/@logical/max) % logical method
However, if you run
doc max
you'll see that max is a function in other toolboxes as well and will be invoked when the object is of that class.
If you are interested in the various overloaded methods of a function, call "which -all max". Titus

댓글을 달려면 로그인하십시오.

Titus Edelhofer
Titus Edelhofer 2011년 11월 23일

2 개 추천

Hi,
usually depfun is indeed the answer, but it has it's limitations as you saw. One rather simple (although not optimal) way is the following: start fresh MATLAB, run your GUI (and click around the buttons that might invoke computations) and try afterwards
license('inuse')
It tells you the toolboxes that have been aquired from the license manager (.i.e., the toolboxes your code used.
Titus
Fangjun Jiang
Fangjun Jiang 2011년 11월 22일

0 개 추천

try depfun()?

댓글 수: 2

joeDiHare
joeDiHare 2011년 11월 23일
this looks very interesting, but for a bit more sofisticated function (e.g. my GUI.m), depfun takes ages untill my machine eventually chrashes.
Do you know how could i do?
Try some of the options of depfun(), such as '-toponly', '-quite'.

댓글을 달려면 로그인하십시오.

Rubaisha Siddiqui
Rubaisha Siddiqui 2017년 5월 9일

0 개 추천

can anybody please tell me to which Toolbox trainedClassifer belongs? everytime i run the code its gives an error Undefined variable "trainedClassifier"

카테고리

도움말 센터File Exchange에서 Debugging and Analysis에 대해 자세히 알아보기

질문:

2011년 11월 22일

답변:

2017년 5월 9일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by