You can threshold your signal:
above1 = yourSignal > 1;
Now you'll have a lot of true and false sections depending on whether your signal is above or below 1, respectively. Now, if you have the Image Processing Toolbox (IPT), you're in luck, you just do
measurements = regionprops(above1, 'Area');
allLengths = [measurements.Area];
Then you need to know how many elements correspond to a time of 2 seconds, and filter those out with ismember(). Not hard (just 2 or 3 lines), but let me know if you have that toolbox first, and if you can't figure it out, I'll let you know, or look in my Image Segmentation Tutorial.
Otherwise, without the IPT you can do it but it's tricky. It's been given in the Answers forum before but I don't remember the steps (because I have the IPT and don't have to).
