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: spm_z2p.m
    path of file: ./repos/ExploreASL/External/SPMmodified
    
    the code of the file until where you have to start completion: function P = spm_z2p(Z,df,STAT,n)

    
function P = spm_z2p(Z,df,STAT,n)
% Compute the p-value of a test statistic
% FORMAT P = spm_z2p(Z,df,STAT,n)
%
% Z     - test statistic {minimum over n values}
% df    - [df{interest} df{error}]
% STAT  - Statistical field
%         'Z' - Gaussian field
%         'T' - T - field
%         'X' - Chi squared field
%         'F' - F - field
% n     - number of conjoint tests
%
% P     - p-value  - P(STAT > Z)
%__________________________________________________________________________
% Copyright (C) 2014 Wellcome Trust Centre for Neuroimaging

% Guillaume Flandin
% $Id: spm_z2p.m 5824 2014-01-02 14:50:13Z guillaume $


if nargin < 4, n    = 1;   end