for i=1:10 C(1,i) = sum(A(1,:) > B(1,i)); end
Vectorized - this will take much more memory, such that it may be slower if your RAM is exhausted:
C = sum(bsxfun('gt', transpose(A), B));
for i=1:10 C(1,i) = sum(A(1,:) > B(1,i)); end
Vectorized - this will take much more memory, such that it may be slower if your RAM is exhausted:
C = sum(bsxfun('gt', transpose(A), B));
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!