function [ MotionData ] = Prep_Normalize( MotionData )

%combine the data into a large batch
batchdata = cell2mat(MotionData.data'); %flatten it into a standard 2d array

%Normalize the data
data_mean = mean(batchdata,1);
data_std = std(batchdata);

for m=1:length(MotionData.data)
    numcases = size(MotionData.data{m},1);
    MotionData.data{m} =( MotionData.data{m} - repmat(data_mean,numcases,1) ) ./ ...
        repmat( data_std, numcases,1);
end


end

