On 07 September 2012 12:55 Carnë Draug wrote > On 7 September 2012 13:06, Kris Thielemans wrote: > > I have only 1 problem. In my matlab code, I normally pass a (double) array > with 0,1 to bwlabeln. This doesn't work for your implementation: > > > > bwlabeln(ones([2,2,3])) > > error: bwlabeln: first input argument must be a 'logical' ND-array > > > > I can fix this by converting to bools of course > > > > bwlabeln(ones([2,2,3]~=0)) > > > > but for matlab compatibility, ideally bwlabeln would do that itself. The > same holds for bwlabel by the way. > > What does matlab do if the double matrix has values different from 0 and 1? >
It seems to compare with 0 as I do above. For example, the following 2 tests work in matlab 2011b tmp=ones([2,3,4]);tmp(2,2,2)=.3;isequal(bwlabeln(tmp),ones(size(tmp))) tmp=randn([2,3,4]);isequal(bwlabeln(tmp),tmp~=0) Kris ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev