MATLAB: Find position of when 0 goes to 1

findlogical?position;

I am trying to determine when a signal is turning on and off. I have 5 signals. I have a nx5 logical of zeros and ones and I want to know when (i.e. position/row number) the signal is on (i.e. when signal=1). I can do this easily to find the first instance but I can't seem to find a function/conditional statement to find the second, third instances, etc.

Best Answer

help strfind
It works with numbers too.
X= rand(1,10)> 0.5
X =
1×10 logical array
0 0 0 0 1 1 0 1 0 0
strfind(X,[0 1])
ans =
4 7