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: randstatprob.m
    path of file: ./repos/malini/Codes/deconvolution - model/spm8/external/fieldtrip/private
    
    the code of the file until where you have to start completion: function p = randstatprob(randobs, realobs, tail, correctm);


    
function p = randstatprob(randobs, realobs, tail, correctm);

% RANDSTATPROB computes the non-parametric probability of the observed
% value under the assumption that the random observations are equally
% probable under the null hypothesis.
%
% Use as
%   p = randstatprob(randobs, realobs, tail, correctm)
% where
%   randobs  = Nvox x Nrnd
%   realobs  = Nvox x 1, or Nvox x Nobs (for multiple observations)
%   tail     =  0 for two-sided test
%   tail     =  1 for one-sided test with realobs>=randobs
%   tail     = -1 for one-sided test with realobs<=randobs
%   correctm =  0 do not correct for multiple comparisons
%               1 correct for multiple comparisons using the maximum statistic
%               2 correct for multiple comparisons using ordered statistics
%
% Each row of the input data contains all the (real or randomized)
% observations in one voxel. Multiple comparison can be performed by
% creating a reference distribution based on the minimum or maximum
% of all voxels for each randomization.

% Copyright (C) 2004-2005, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% for the documentation and details.
%
%    FieldTrip is free software: you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    FieldTrip is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with FieldTrip. If not, see <http://www.gnu.org/licenses/>.
%
% $Id: randstatprob.m 7123 2012-12-06 21:21:38Z roboos $

if nargin<3
  tail = 0;
end