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: CreatePatchExpert.m
    path of file: ./repos/OpenFace/model_training/CCNF/patch_experts/svr_training
    
    the code of the file until where you have to start completion: function [ patch_expert, corr, rms_error] = CreatePatchExpert( samples, labels, unnormed_samples, normalisation_options)
%CREATEPATCHEXPERT Summary of this function goes here
%   Detailed explanation goes here


    
function [ patch_expert, corr, rms_error] = CreatePatchExpert( samples, labels, unnormed_samples, normalisation_options)
%CREATEPATCHEXPERT Summary of this function goes here
%   Detailed explanation goes here

    num_examples = size(samples, 1);
    
    region_length = normalisation_options.normalisationRegion - normalisation_options.patchSize + 1;
    region_length = region_length(1) * region_length(2);    
    
    % this part sets the split boundaries for SVR training, logit training and test subsets
    train_SVR_start = 1;        
    train_SVR_end