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: xASL_im_ResampleLinearFair.m
    path of file: ./repos/ExploreASL/WorkInProgress/Outdated
    
    the code of the file until where you have to start completion: function output_res = xASL_im_ResampleLinearFair(im_input, newsize)
%xASL_im_ResampleLinearFair Downsample or upsample a 1D/2D/3D image
%
% FORMAT:       output_res = x
    
function output_res = xASL_im_ResampleLinearFair_3D(old_res,new_res)

    % Dummy initialization
    output_res = 0;

    % Feedback
    fprintf('Resample:    ');
    
    % Iterate over image
    for k=1:size(new_res,3)
        % Prepare new_res blocks
        for j=1:size(new_res,2)
            % Prepare new_res blocks
            for it=1:size(new_res,1)
                output_res = xASL_im_ResampleLinearFair_Loop3D(it,j,k,old_res,new_res,output_res);
            end