I understand that you wish to detect pulse widths along with their time-stamps and threshold the signal based on width.
The function 'pulsewidth' can be very useful in this regard as it outputs the widths and time information as well. Documentation for the same can be found at :
Once the widths and start-time of each pulse is known it can be used to capture wanted pulses. Following code snippet shows how 'pulsewidth' can be used:
>>A = rand(100,1);
>>B = A > 0.5;
>>[wid, P_start, P_end, midL] = pulsewidth(double(B));
Thus "PulseInd" contains the index where a pulse begins and "wid" contains the width of that particular pulse. Using this information the signal can be thresholded and desired result obtained.