How to segment an EMG signal according to a column value?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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?
0 commentaires
Réponse acceptée
Image Analyst
le 21 Fév 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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Dimensionality Reduction and Feature Extraction dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!