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_ut_function_xASL_stat_PSNR.m
    path of file: ./repos/ExploreASL/Testing/UnitTests
    
    the code of the file until where you have to start completion: function UnitTest = xASL_ut_function_xASL_stat_PSNR(TestRepository)
%xASL_ut_function_xASL_stat_PSNR Individual unit test for xASL_stat_PSNR
%
% INPUT:        TestRepository - Path to test repository.
%
% OUTPUT:       UnitTest  - Test structure
%               name      - Name of tested module or submodule (char array)
%               unit      - Insert one of the following: 'Module', 'Submodule' or 'Function'
%               passed    - Result of all subtests combined (true or false)
%               test      - Structure with individual subtest results
%
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% DESCRIPTION:  Should be run using xASL_ut_UnitTesting.
%
% EXAMPLE:      UnitTests(1) = xASL_ut_function_xASL_stat_PSNR(TestRepository);
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% Copyright 2015-2021 ExploreASL


%% Test run 1

% Give your individual subtest a name
UnitTest.tests(1).testname = 'Artificial noise examples';

% Start the test
testTime = tic;

% Prepare test
xASL_Copy(fullfile(TestRepository,'UnitTesting','dro_files','test_patient_2_3_0','rawdata','sub-001','perf','sub-001_acq-001_asl.nii.gz'),...
          fullfile(TestRepository,'UnitTesting','working_directory','test.nii.gz'))
im = xASL_io_Nifti2Im(fullfile(TestRepository,'UnitTesting','working_directory','test.nii.gz'));
xASL_delete(fullfile(TestRepository,'UnitTesting','working_directory','test.nii.gz'));

% Run your test here
imNoiseless = im;
randomMatrix = rand(size(im),'single');
downscaledMatrix = randomMatrix.*0.00001;
noisyImage1 = imNoiseless+downscaledMatrix*1;
noisyImage2 = imNoiseless+downscaledMatrix*10;
noisyImage3 = imNoiseless+downscaledMatrix*100;
noisyImage4 = imNoiseless+downscaledMatrix*1000;
PSNR1 = xASL_stat_PSNR(imNoiseless,noisyImage1);
PSNR2 = xASL_stat_PSNR(imNoiseless,noisyImage2);
PSNR3 = xASL_stat_PSNR(imNoiseless,noisyImage3);
PSNR4 = xASL_stat_PSNR(imNoiseless,noisyImage4);

% Define one or multiple test conditions here
testCondition = true;

    
function UnitTest = xASL_ut_function_xASL_stat_PSNR(TestRepository)
%xASL_ut_function_xASL_stat_PSNR Individual unit test for xASL_stat_PSNR
%
% INPUT:        TestRepository - Path to test repository.
%
% OUTPUT:       UnitTest  - Test structure
%               name      - Name of tested module or submodule (char array)
%               unit      - Insert one of the following: 'Module', 'Submodule' or 'Function'
%               passed    - Result of all subtests combined (true or false)
%               test      - Structure with individual subtest results
%
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% DESCRIPTION:  Should be run using xASL_ut_UnitTesting.
%
% EXAMPLE:      UnitTests(1) = xASL_ut_function_xASL_stat_PSNR(TestRepository);
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% Copyright 2015-2021 ExploreASL


%% Test run 1

% Give your individual subtest a name
UnitTest.tests(1).testname = 'Artificial noise examples';

% Start the test
testTime = tic;

% Prepare test
xASL_Copy(fullfile(TestRepository,'UnitTesting','dro_files','test_patient_2_3_0','rawdata','sub-001','perf','sub-001_acq-001_asl.nii.gz'),...
          fullfile(TestRepository,'UnitTesting','working_directory','test.nii.gz'))
im = xASL_io_Nifti2Im(fullfile(TestRepository,'UnitTesting','working_directory','test.nii.gz'));
xASL_delete(fullfile(TestRepository,'UnitTesting','working_directory','test.nii.gz'));

% Run your test here
imNoiseless = im;
randomMatrix = rand(size(im),'single');
downscaledMatrix = randomMatrix.*0.00001;
noisyImage1 = imNoiseless+downscaledMatrix*1;
noisyImage2 = imNoiseless+downscaledMatrix*10;
noisyImage3 = imNoiseless+downscaledMatrix*100;
noisyImage4 = imNoiseless+downscaledMatrix*1000;
PSNR1 = xASL_stat_PSNR(imNoiseless,noisyImage1);
PSNR2 = xASL_stat_PSNR(imNoiseless,noisyImage2);
PSNR3 = xASL_stat_PSNR(imNoiseless,noisyImage3);
PSNR4 = xASL_stat_PSNR(imNoiseless,noisyImage4);

% Define one or multiple test conditions here
testCondition = true;

% Define one or multiple test conditions here
if ~isnumeric(PSNR1) || ~isnumeric(PSNR2) || ~isnumeric(PSNR3) || ~isnumeric(PSNR4)
    testCondition = false;
end