Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am getting an error in line number 45 of file 'autoclust_optimize.m' #1

Open
praveenkul opened this issue Aug 11, 2014 · 3 comments

Comments

@praveenkul
Copy link

In line number 45 of file 'autoclust_optimize.m' which contains below code
[~,candidatepatches]=ismember(mydetrs,prevdets(:,6),'R2012a');
I am getting an Error:
MATLAB:ISMEMBER:UnknownFlag

I am using the Matlab version number R2009b. So the flag 'R2012a' is unknown. If I try to remove the flag or use the 'legacy' option, I get the error as 'classperbatch wrong' at line number 47.
What would be the alternate line of code to make it work on R2009b.

Thanks
Praveen

@cdoersch
Copy link
Owner

Recent versions of Matlab have changed how ismember works; the second output returned the last index that matched; however, since R2012a, it returns the first. I've been meaning to rewrite the code to not rely on this behavior, but it's a fairly large job since I use ismember a lot.

A simple fix is to replace the line you posted with the following code (which will break the code in R2012a and later):

[~,candidatepatches]=ismember(mydetrs,prevdets(end:-1:1,6));
candidatepatches=size(prevdets,1)-candidatepatches+1;

However, I can't guarantee that nothing else will break when you use R2009b; I think all the times when I rely on R2012a behavior are marked with the R2012a flag, but I've never tested with such an old version of matlab.

@praveenkul
Copy link
Author

Thanks for reply I have relaunched the code with the fix you mentioned.
I searched in complete directory but I did not find any other place where the flag R2012a is being set. So I hope code will not break with other ismember functions.

@cdoersch
Copy link
Owner

Hey praveen,

Could you open a new issue for this? It doesn't seem related to the last issue.

It sounds to me like you either don't have the statistics toolbox (the linkage2 function is actually a patched version of the statistics toolbox function, and relies on some of its internal functions), or there's something that's changed with your version of the stats toolbox. If the stats toolbox functions aren't available, you can alter findOverlapping3 to return a trivial clustering (i.e. each element in the same cluster), which will theoretically make the code behave like the 'no inter-element communication' version in the paper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants