Prev: Code for cbir in matlab
Next: bpv4c problem
From: Matt J on 22 Dec 2009 10:48 "Oleg Komarov" <oleg.komarov(a)hotmail.it> wrote in message <hgqp6o$m7d$1(a)fred.mathworks.com>... > Nicholas, > since 'x' is a vector, 'if x' doesn't return a boolean value (true or false). That's not entirely true. "if z" is equivalent to "if all(real(z))" (see help doc on if) Since all(real(x>5))=0, in this case, the if statement always evaluates to false.
From: Oleg Komarov on 22 Dec 2009 10:53
Matt J, > > since 'x' is a vector, 'if x' doesn't return a boolean value (true or false). > > That's not entirely true. "if z" is equivalent to "if all(real(z))" (see help doc on if) > > Since all(real(x>5))=0, in this case, the if statement always evaluates to false. > > Totally right, forgot about this behaviour. |