How to segment an EMG signal according to a column value?

8 visualizaciones (últimos 30 días)
RIFAT
RIFAT el 21 de Feb. de 2024
Comentada: RIFAT el 21 de Feb. de 2024
I have am EMG dataset, where multiple datas are combined together according to class in a column. Each class represent different muscle activity. Like, class is marked as 1 for hand at rest, where 2 for wrist flexion. I want to segment that data according to class 1 or 2. How to segment this dataset?

Respuesta aceptada

Image Analyst
Image Analyst el 21 de Feb. de 2024
If your data are in a regular matrix, you can use indexing to extract rows for that class. For example if column 2 contains the class number, you can do
%-------------------------------------------------------------------------------------------
% Get indexes for the rows for the desired class numbers
% Find rows that are marked as class 1.
class1Rows = data(:, 2) == 1;
% Find rows that are marked as class 1.
class2Rows = data(:, 2) == 2;
% Find rows that are marked as EITHER class 1 or class 2.
class1Orclass2Rows = class1Rows | class2Rows;
%-------------------------------------------------------------------------------------------
% Using those indexes, extract the data for the desired class numbers into new variables.
class1 = data(class1Rows, :); % Extract only class 1 rows.
class2 = data(class2Rows, :); % Extract only class 2 rows.
class1OR2 = data(class1Orclass2Rows, :); % Extract if it's EITHER class 1 OR class 2.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by