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: pcmprctilelatlon.m
    path of file: ./repos/pcm/matlab/src
    
    the code of the file until where you have to start completion: function varargout = pcmprctilelatlon(GMMMASK,PCM,DPT,FIELD,M,varargin)
% pcmprctilelatlon Compute the percentile at each depth levels from a PCM and a given collection of gridded profiles
%
% Y = pcmprctilelatlon(MASK,PCM,DPT,DATA,M,[PAR,VAL])
%
% REQUIRED INPUTS:

    
function varargout = pcmprctilelatlon(GMMMASK,PCM,DPT,FIELD,M,varargin)
% pcmprctilelatlon Compute the percentile at each depth levels from a PCM and a given collection of gridded profiles
%
% Y = pcmprctilelatlon(MASK,PCM,DPT,DATA,M,[PAR,VAL])
%
% REQUIRED INPUTS:
% 	MASK(Ny,Nx): 0/1 mask to define profiles to classify in the lat/lon grid
%	PCM (struct): A Profile Classification Model structure
% 	DPT(Nz,1): Depth axis of DATA (used to call pcmpredict and get the activation values)
% 	DATA(Nz,Ny,Nx): A gridded collection of profiles
% 	M: scalar or vector of percent values between 0 and 100
% 
% OPTIONAL INPUTS as [PAR,VAL]: List of optional parameters/values: 
% 	REDUCED: 0 (default) / 1: Indicate if DATA is reduced or not. If it's reduced
% 		real data will be recomposed using MODEL info.
% 	WEIGHT(Ny,Nx,K): Possibly provide the profile weights to use to compute histograms.
% 		If not provided, DATA is classified using pcmpredict and ACTIVATIONS are used.
% 	CLASS: A list of integers to specify the class to determine
%
% OUTPUTS:
% 	Y: Percentiles of the values in DATA and CLASS
% 
% RQ:
% 	This is a simple wrapper of the pcmprctile function to handle gridded data
%
% See also: pcmprctile, pcmpdfzlatlon
%
% PCM is Profile Classification Modelling
% Copyright (C) 2016-2017, OBIDAM Developpers
% For more information, see http://github.com/obidam/pcm
% Created: 2016-04-15 (G. Maze, Ifremer, Laboratoire d'Oc√©anographie Physique et Spatiale)

% This file is part of OBIDAM/PCM.
%     OBIDAM/PCM 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.
%     OBIDAM/PCM 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 Foobar.  If not, see <http://www.gnu.org/licenses/>.


%- Load user parameters:
rnin = 5;
if nargin > rnin
    if mod(nargin-rnin,2) ~= 0
        error('Parameters must come in pairs: PAR,VAL');
    end