c =1;
for file=files'
AV8WalkSegments{c} = ReadSegments(['./',file.name],1,200);
c = c+1
end


SegmentIndices = zeros(length(AV8WalkSegments),2);

for jj = 1:size(SegmentIndices,1)
    jj
    s=-1;
    e=-1;
    
    for i=1:size(AV8WalkSegments{jj},1)
        if strcmp(AV8WalkSegments{jj}{i,3},'T-POSE')==1 && s==-1
            s=AV8WalkSegments{jj}{i,2}+1;
        else if strcmp(AV8WalkSegments{jj}{i,3},'T-POSE')==1 %&& e==-1
                e=AV8WalkSegments{jj}{i,1}-1;
            end
        end
    end
    SegmentIndices(jj,:) = [s,e];
    SegmentIndices(jj,:) = [floor(s),floor(e)];
    
    %Motion{jj} = Motion{jj}(floor(s/4):floor(e/4),:); %remove the T-poses
    Motion2{jj} = Motion{jj}(s+10:e-10,:); %remove the T-poses
end

clear files AV8WalkSegments c jj i e s;

    
