Those operators perform shortcut evaluation similar to the comparable C operators. That is a || b only evaluates b of a is false, and a && b only evaluates b if a true. It will not do this shortcut evaluation on a point by point basis.
Since at least one of your operands appears to be a vector of boolean conditions (Vec(ii,:)~=0
), Matlab is telling you that the shortcut evaluation cannot be peformed.
You put this in an if, so you needed a single scalar boolean anyway. I would guess that you meant the scalar first operand as any(Vec(ii,:)~=0)
rather than the vector.