home_dir = 'D:\DS\Activity_Recognition';
for sens =3:length(sensors)
classes = dir(fullfile(home_dir, sensors(sens).name));
for cls=3:length(classes)
data = dir(fullfile(home_dir, sensors(sens).name, classes(cls).name));
toWrite = cell(zeros(1,1));
tmp = load(fullfile(home_dir, sensors(sens).name, classes(cls).name, data(dat).name));
if n_rows < n_rows_target
tmp(n_rows+1:n_rows_target,:) = repmat(mean_tmp,n_rows_target-n_rows,1);
xTmp = tmp(((ch-1)*200)+1:ch*200, 1);
yTmp = tmp(((ch-1)*200)+1:ch*200, 1);
zTmp = tmp(((ch-1)*200)+1:ch*200, 1);
xFeat = computeStatFeats(xTmp, length(xTmp));
yFeat = computeStatFeats(yTmp, length(yTmp));
zFeat = computeStatFeats(zTmp, length(zTmp));
toWrite{dat-2, 1} = [xFeat yFeat zFeat];
fprintf('Computing %s Features: %d\n', classes(cls).name, length(data)-dat-2);
toWrite = cell2mat(toWrite);
writematrix(toWrite, strcat(sensors(sens).name, '_', strrep(classes(cls).name, ' ', '_'), '.csv'));