need loop to run the below code

i have below data -
time vector (sec), time = [1;2;3;4;5;6;.....;n]; (nx1)
enable vector, enbl =[0;0;0;1;1;1;1;1;1;1;0;0;0;0;0;1;1;......]; (nx1)
I want to create a enable2 vector with below condition -
If time between enbl (==1) is less than 10 sec, then i want enable2 to be 0 else enable2 = enbl.
thanks

1 comentario

Andrei Bobrov
Andrei Bobrov el 25 de Feb. de 2020
Editada: Andrei Bobrov el 25 de Feb. de 2020
Please attach here your data (time and enbl) as mat-file.

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Preguntada:

el 25 de Feb. de 2020

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by