I need to find the index of the first 1 in a logical vector.
For example, I have a logical vector like this: V = [ 0 1 0 0 1 0 1 ] and I need a function/code that will tell me that the first true value is at index 2.
(If you can't tell from my question, I'm a beginner at Matlab.) Thanks so much for your help! I really appreciate it 🙂
Best Answer