From: <car...@us...> - 2011-12-05 00:53:14
|
Revision: 9263 http://octave.svn.sourceforge.net/octave/?rev=9263&view=rev Author: carandraug Date: 2011-12-05 00:53:07 +0000 (Mon, 05 Dec 2011) Log Message: ----------- isbw: made function still return true for non-logical matrix of 1 and 0 but issue warning. This will be changed again in future Modified Paths: -------------- trunk/octave-forge/main/image/inst/isbw.m Modified: trunk/octave-forge/main/image/inst/isbw.m =================================================================== --- trunk/octave-forge/main/image/inst/isbw.m 2011-12-05 00:47:20 UTC (rev 9262) +++ trunk/octave-forge/main/image/inst/isbw.m 2011-12-05 00:53:07 UTC (rev 9263) @@ -43,17 +43,20 @@ ## this is the matlab compatible way (before they removed the function) bool = islogical (BW); - ## the following block is just temporary since we are not being backwards compatible + ## the following block is just temporary to keep backwards compatibility if (!islogical (BW) && all (all ((BW == 1) + (BW == 0)))) persistent warned = false; if (! warned) warned = true; warning ("isbw: image is not logical matrix and therefore not binary but all values are either 0 and 1.") - warning ("isbw: old versions of the function would return true. Use the call isbw (img, \"non-logical\") instead.") + warning ("isbw: future versions of this function will return true. Consider using the call isbw (img, \"non-logical\").") endif + bool = true; endif + ## end of temporary block for backwards compatibility elseif (strcmpi (logic, "non-logical")) bool = all (all ((BW == 1) + (BW == 0))); endif + endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |