Segmenting EMG via a Loop

3 visualizaciones (últimos 30 días)
Ryan Chhiba
Ryan Chhiba el 20 de Mzo. de 2021
Respondida: Star Strider el 20 de Mzo. de 2021
I have been using this for loop code to window time data into 20 second segments. I Have been trying to use te same code to segment EMG data into 20 second segments but it does not run. There is no error that pops up, it just does not work. Would anyone have some insight to where I am going wrong? Thanks
Fs= 2048
length_time = length(Processed_EMG.EMG_Processed.Conditioned_EMG.notch_480_DDE_SCM_L);
segment= 20;
n= Fs*segment;
int= floor(length_time/n);
for i= 1:int
win_time_begin(i) = n*(i-1);
win_time_end(i) = n*(i);
win(i,:) = win_time_begin(i):1:win_time_end(i);
end

Respuesta aceptada

Star Strider
Star Strider el 20 de Mzo. de 2021
If the value of ‘int’ is less than 1, the loop counter is satisfied at the outset, and the loop never iterates.
The Signal Processing Toolbox buffer function is what I always use to segment signals. It is just easier than writing my own code.

Más respuestas (0)

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by