How can I work around depfun(bar) bug: Matlab 64bit 2012B, on win7

1 view (last 30 days)
  • Background: I'm using matlab to perform some data processing in an academic environment. The code for the analysis receives frequent tweaks and changes.
  • Goal: I'd like the main processing function to save copies of all the user functions called during the analysis alongside the processed files, as a record of what was done in that specific iteration of the analysis. the function 'depfun' seems ideal for this purpose, all I need to do is filter out the dependencies that are in the matlab toolboxes and I have a list of the user functions which I can then copy over to my output folder.
  • Problem: One of the things the analysis does is generate and save some bar charts using the 'bar' function. When depfun reaches bar it seems to go into an infinite loop and never returns. ctrl+c fails to stop the process and I must force-quit matlab. This prevents retrieval of any of the dependencies using depfun. This problem exists whether bar is called within one of the dependency functions, or whether depfun(bar) is called directly. I am using Matlab 2012b 64bit on windows 7.
  • Question: Is there a workaround for this error, or a way to generate a dependency list that ignores functions from the matlab toolboxes so that I don't encounter it? *I tried the depsubfun function from the matlab exchange with similar results
Thanks

Accepted Answer

per isakson
per isakson on 23 Jan 2014
Edited: per isakson on 24 Jan 2014
depfun takes ages to search the sub-directories of matlabroot. There are several(?) depfun replacements in the FEX, which avoids files belonging to the Matlab installation. They use
list = depfun(func,'-toponly','-quiet');
recursively on the users directories. See:
depsubfun is older (MATLAB 7.0.1 (R14SP1), 2005) than the poor performance of depfun (if I am not mistaken). It doesn't use the toponly keyword
f = depfun(CS{i},'-quiet');

More Answers (1)

Tucker
Tucker on 24 Jan 2014
Thanks for the suggestion, this matches well with the advice i received from the mathworks support when I reported the bug. I implemented a solution myself before I came back and noted your reply, but the general method you outline works well. I haven't specifically checked out your suggestions, only because I had already written and tested a function that does this prior to coming back to make this update, but a function to address my needs with no optional features takes only a few lines.
Cheers

Categories

Find more on Search Path in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!