-
Notifications
You must be signed in to change notification settings - Fork 1
/
muscleresponse.m
40 lines (40 loc) · 1 KB
/
muscleresponse.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
function [A Q] = muscleresponse(l)
frs = 0;
frf = 0;
fds = 0;
fdf = 0;
fneg = 0;
for i = 1:1:length(l)
if l(i,1) >= 200
if fneg == 0
if l(i,2) < 0
fneg = 1;
end
elseif fneg == 1
if frs == 0
if l(i,2) > 0
frs = l(i,1);
end
else
if l(i,2) > 0
frf = l(i,1);
else
fds = l(i,1);
fneg = 2;
end
end
elseif fneg == 2
if l(i,2) < 0
fdf = l(i,1);
else
fneg = 3;
end
end
end
end
sprintf('Activity = %g (from %g to %g)\nQuiescence = %g (form %g to %g)', (frf - frs), frs, frf, (fdf - fds), fds, fdf)
if nargout>0
A = frf - frs;
Q = fdf - fds;
end
end