function [ MotionData ] = Prep_Normalize( MotionData, CRBMConfig )

%Normalize the data
data_mean = CRBMConfig.data_mean;
data_std = CRBMConfig.data_std;

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

MotionData.mean = data_mean;
MotionData.std = data_std;
end

