-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnorm_force_files.m
53 lines (38 loc) · 1.3 KB
/
norm_force_files.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
47
48
49
50
51
52
53
clear all
%%
name = '406_EMG';
path = 'C:\Users\Niko\Desktop\Phasic_PCA\C3D_Files\Collected_Force_files\EMG_NORMALIZATION_NEW\';
% path = 'C:\Users\Niko\Desktop\Phasic_PCA\C3D_Files\402_dec_6\';
% path = 'C:\Users\Niko\Desktop\Phasic_PCA\C3D_Files\370_Sept_27\';
% path = 'C:\Users\Niko\Desktop\Phasic_PCA\C3D_Files\346_August_29\';
% path = 'C:\Users\Niko\Desktop\Phasic_PCA\C3D_Files\345_August_30\';
name_short = name;
[dataANA,txt_ANA,raw_ANA] = importdata([path,name_short,'.txt']);
dataTXT = dataANA.textdata;
dataANA= dataANA.data;
phasic_Index = find(dataANA(:,1)==1);
normData=[];
for x = 2:size(dataANA,2)
normData = [normData,(dataANA(:,x)- std(dataANA(phasic_Index,x)))/mean(dataANA(phasic_Index,x))];
end
filename = [path,name,'_norm.xls'];
A ={};
A = {'GaitCycle','Leg','Condition','MeanAmp','PeakValue','Peak_to_Peak','RMS','iForce'...
'MeanAmp_F','PeakValue_F','Peak_to_Peak_F','RMS_F','iForce_F'};
for x = 1 :size(normData,1)
A{x+1,1} = dataTXT{x+1,1};
A{x+1,2} = filename;
A{x+1,3} = dataANA(x,4);
A{x+1,4} = normData(x,1);
A{x+1,5} = normData(x,2);
A{x+1,6} = normData(x,3);
A{x+1,7} = normData(x,4);
A{x+1,8} = normData(x,5);
A{x+1,9} = normData(x,6);
A{x+1,10} = normData(x,7);
A{x+1,11} = normData(x,8);
A{x+1,12} = normData(x,9);
A{x+1,13} = normData(x,10);
end
%%
xlswrite(filename,A)