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: get_files.m
    path of file: ./repos/HOG-Pedestrian-Detector
    
    the code of the file until where you have to start completion: function [positive_images, negative_images] = get_files(pos_elems, neg_elems, paths)
% GET_FILES retrieves complete paths to every JPG, PNG or PPM image file. 
%  
% INPUT:
%       pos/neg_elems: pos/negs max elems to retrieve
%       paths: paths from where to retrieve image paths
%
% OUTPUT:
%       positive / negative_images: paths to the images.
%
%$ Author: Jose Marcos Rodriguez $ 
%$ Date: 25-Dec-2013 23:41:52 $ 
%$ Revision : 1.00 $ 
%% FILENAME  : get_files.m 

IMG_WILDCARDS = {'*.jpg','*.png','*.ppm'};

    %% path stuff
    if nargin < 3
        positive_images_path = uigetdir('.images','Select positive image folder');
        negative_images_path = uigetdir('.images','Select negative image folder');

    
function [positive_images, negative_images] = get_files(pos_elems, neg_elems, paths)
% GET_FILES retrieves complete paths to every JPG, PNG or PPM image file. 
%  
% INPUT:
%       pos/neg_elems: pos/negs max elems to retrieve
%       paths: paths from where to retrieve image paths
%
% OUTPUT:
%       positive / negative_images: paths to the images.
%
%$ Author: Jose Marcos Rodriguez $ 
%$ Date: 25-Dec-2013 23:41:52 $ 
%$ Revision : 1.00 $ 
%% FILENAME  : get_files.m 

IMG_WILDCARDS = {'*.jpg','*.png','*.ppm'};

    %% path stuff
    if nargin < 3
        positive_images_path = uigetdir('.images','Select positive image folder');
        negative_images_path = uigetdir('.images','Select negative image folder');
        
        if isa(positive_images_path,'double')  || ...
           isa(negative_images_path,'double')
            cprintf('Errors','Invalid paths...\nexiting...\n\n')
            return 
        end