I have generated a vector "SleepData" that creates a 7200x1 vector of random #s from 0-12. I want the vector sensor data to have the value 1 when SleepData > 4. I have been able to do this.
I need help to make it so that the value of 1 lasts for 300 more indicies following the each initiation of 1. How can I do this?
SENSOR = zeros(length(SleepData),1);
SENSOR(SleepData>=4) = 1;