so I'm trying to know when an event happened before another event in matlab; by event I mean number. For example, I have a vector, let's say:
x = [0.3 0.3 0.1 0.2 0.5 0.1 0.3 0.1 0.5 0.1 0.4 0.5]
and I want to know in which position is the 0.1 that happened before a 0.5. I tried with find(x,0.5,'last') but that doesn't help much since I want to then find the 0.1. I thought about maybe creatig another vector that ended at the 0.5 and then search for the last 0.1 but that would just be sort of inefficient since my vectors contain ~300 events.