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: runICPTransformFinal.m
    path of file: ./repos/Point_cloud_tools_for_Matlab/classes/@globalICP/private
    
    the code of the file until where you have to start completion: function obj = runICPTransformFinal(obj, p, g)

msg('S', {g.proc{:} 'TRANSFORMATION'}, 'LogLevel', 'basic');

    
function obj = runICPTransformFinal(obj, p, g)

msg('S', {g.proc{:} 'TRANSFORMATION'}, 'LogLevel', 'basic');

for i = 1:g.nPC
    
    % Find new path
    [~, file] = fileparts(obj.PC{i});
    p2mat = fullfile(obj.OutputFolder, [file '_POSTICP.mat']);
    
    if ~ismember(i, p.IdxFixedPointClouds) % trafo only if point cloud is not fixed, i.e. loose

        % Load point cloud
        PC = obj.loadPC(i);

        % Trafo
        PC.transform(1, obj.D.H{1,i}(1:3,1:3), obj.D.H{1,i}(1:3,4));

        % Update mat file
        PC.save(p2mat);
        
    else
        
        % Copy original mat file
        copyfile(obj.PC{i}, p2mat);
        
    end