From: Matt J on
"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
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.
First  |  Prev  | 
Pages: 1 2
Prev: Code for cbir in matlab
Next: bpv4c problem