X = [0.11, 0.72, 0.32, 0.94]Q = [0.1; 0.3; 0.6; 1.0; 2.0; 3.0]length(Q) - sum(bsxfun(@le, X, Q)) + 1
Standard input is empty
X = 0.11000 0.72000 0.32000 0.94000 Q = 0.10000 0.30000 0.60000 1.00000 2.00000 3.00000 ans = 2 4 3 4
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!