You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: GaitPhaseTraining.m
    path of file: ./repos/RFM/function/main
    
    the code of the file until where you have to start completion: %% Training gait phase 
function DB = GaitPhaseTraining(DB)

if DB.opt.PhaseDivisionNumber > 1 && sum(DB.opt.GaitRecogMethod == [1,4,7,8]) 
    
    % Transform feature
    if DB.opt.new_temporal_feature == 1 % new feature
        feature = new_temporal_feature(DB); 
    
    
function DB = GaitPhaseTraining(DB)

if DB.opt.PhaseDivisionNumber > 1 && sum(DB.opt.GaitRecogMethod == [1,4,7,8]) 
    
    % Transform feature
    if DB.opt.new_temporal_feature == 1 % new feature
        feature = new_temporal_feature(DB); 
        feature = feature';
    elseif DB.opt.new_temporal_feature == 2 % normalization
        feature = DB.feature.all;
        for i = 1 : size(feature, 2)/3
            idx = i : size(feature, 2)/3 : size(feature, 2);
            feature(:, idx) = feature(:, idx)./repmat(sqrt(sum(feature(:, idx).^2, 2)), [1, 3]);
        end