MATLAB: Any(cell{i}) doesn’t work (loop)

anycell arraysless thanloopmore than

Hello
The following does not work at the part where cell arrays are. I believe the "any function" does not work the way i want it to – it doesn't produce an error, but it doesn't work either. I want to check if any of the values in cell a and N (which consists of vectors).
for i = 1 : length(W)
if X(i) < 20 || X(i) > 30 || Y(i) < 50 || Y(i) > 150 ...
|| any(a{i}) < 0 || any(a{i}) > 12 ...
|| any(N{i}) < 13 || any(N{i}) > 40
X(i) = [];
Y(i) = [];
a{i} = [];
N{i} = [];
fprintf('Error in test subject %d, discarding dataline.\n',l)
end
end

Best Answer

Could it be that you meant to write
any(a{i}<0)
instead of
any(a{i})<0
likewise for the others ??
Titus