Provided that data is strictly increasing:
[junk, binnum] = histc(A, [-inf data inf]);
The binnum returned will be an index K such that A goes strictly before the K'th value -- so if A exactly matches the K'th value, K+1 would be returned. If length(data) + 1 is returned, then the A value either exactly matches or exceeds the last data value.
Feel free to subtract 1 from the result if that makes things easier: that would mean that a returned value of 0 means that the data precedes the first data value.
A can be a vector of values.
Note that, as per usual, if your data values are non-integral, you need to consider round-off errors: a value that is algebraically (say) 4, might numerically get calculated as 4*(1-eps) or even smaller.