function [CumSumLastVal, NormCumSumLastVal] = GetNormCumSumLastVal (Group)
 %input: group is  a cell containing cumulative sum values of the group 

AnimalNum = size(Group,1);
TrialNum = cellfun(@length, Group);

CumSumLastVal = zeros(AnimalNum,1);
for i = 1:AnimalNum
    CumSumLastVal(i) = Group{i}(end);
end

NormCumSumLastVal = CumSumLastVal./TrialNum;





