I have code which does
for t = 1: length(vector2) idx(t) = find(vector <=vector2(t), 1, 'last');end
Can I call find.m without using a for loop (or bsxfun.m) and if so how?
Or should I just use histc?
[~,idx]=histc(vector2, vector);
findhistc
for t = 1: length(vector2) idx(t) = find(vector <=vector2(t), 1, 'last');end
[~,idx]=histc(vector2, vector);
Best Answer