-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathemg.m
46 lines (36 loc) · 1.2 KB
/
emg.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
classdef emg < handle
% EMG - A class to store muscle activation data recorded from experiments
%
%
% Created by Megan Schroeder
% Last Modified 2014-03-27
%% Properties
% Properties for the emg class
properties (SetAccess = private)
SampleTime
Data
end
properties (SetAccess = public)
Norm % Normalized to % of cycle (added in 'simulation' class)
end
%% Methods
% Methods for the emg class
methods
function obj = emg(subID,simName)
% EMG - Construct instance of class
%
% EMG path
emgPath = [OpenSim.getSubjectDir(subID),subID,'_',simName,'_EMG.mot'];
% Import the file
motimport = importdata(emgPath,'\t',7);
% Column headers
emgnames = motimport.colheaders(2:end);
% Time
timedata = motimport.data(:,1);
obj.SampleTime = timedata;
% Data
emgdataset = dataset({motimport.data(:,2:end),emgnames{:}});
obj.Data = emgdataset;
end
end
end