MATLAB: Getting the position of a value in a vector

position;simplevector

Hey Matlab community, I have another one for you all. I have a vector of values BAC_F that corresponds with time, and I want the first position of BAC(BAC_F<.08) , but I can't quite figure it out. Any help and suggestions are appreciated.

Best Answer

If you want the index of the first value where BAC < 0.08:
BACx = find(BAC < 0.08, 1, 'first')