|
thank you, Lucio.
Regards,
Hao Zheng (Arthur)
ECE, Georgia Tech
"Lucio Andrade-Cetto" <lcetto@nospam.mathworks.com> wrote in message <ghldsm$2ts$1@fred.mathworks.com>...
> That's correct, "any" seems to be bogus here
> Lucio
>
> "Arthur Zheng" <hzheng7@gatech.edu> wrote in message <ghkt85$6t4$1@fred.mathworks.com>...
> > Hi,
> > I have typed "edit knnclassify" in matlab 2008a. There is part of the knnclassify function code as follows:
> > ------------------------------------------------------------------------
> > % lots of testers misspelled consensus.
> > if any(strncmpi(rule,'conc',4))
> > rule(4) = 's';
> > end
> > --------------------------------------------------------------------------
> >
> > I am wondering if there is some use for the function "any" in the above code?
> > What I mean is that if there is any difference between the above code and the following:
> >
> > -------------------------------------------------------------------------
> > % lots of testers misspelled consensus.
> > if (strncmpi(rule,'conc',4))
> > rule(4) = 's';
> > end
> > ------------------------------------------------------------------------
> >
> > I have tested the above two code segments using
> > if any(strncmpi('concensus', 'conc',4)) a=5;end
> > if (strncmpi('concensus', 'conc',4)) a=5;end
> >
> > And I didn't see the difference. Thank you!
> >
> > Regards,
> > Hao Zheng (Arthur)
> > ECE, Georgia Tech
|