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: tracker_load.m
    path of file: ./repos/toolkit-legacy/tracker
    
    the code of the file until where you have to start completion: function [tracker] = tracker_load(identifier, varargin)
% tracker_load Create a new tracker descriptor structure
%
% tracker = tracker_load(identifier, ...)
%
% Create a new tracker structure by searching for a tracker definition file using given
% tracker identifier string.
%
% Input:
% - identifier: A valid tracker identifier string. See `valid_identifier` for more details.
% - varargin[Version]: Version of a tracker. See tracker versioning for more details.
% - varargin[MakeDirectory]: A boolean indicating if a result directory should be automatically generated.
%
% Output:
% - tracker: A new tracker structure.

version = [];
makedirectory = true;

for i = 1:2:length(varargin)

    
function [tracker] = tracker_load(identifier, varargin)
% tracker_load Create a new tracker descriptor structure
%
% tracker = tracker_load(identifier, ...)
%
% Create a new tracker structure by searching for a tracker definition file using given
% tracker identifier string.
%
% Input:
% - identifier: A valid tracker identifier string. See `valid_identifier` for more details.
% - varargin[Version]: Version of a tracker. See tracker versioning for more details.
% - varargin[MakeDirectory]: A boolean indicating if a result directory should be automatically generated.
%
% Output:
% - tracker: A new tracker structure.

version = [];
makedirectory = true;

for i = 1:2:length(varargin)
    switch lower(varargin{i})
        case 'version'
            version = varargin{i+1};
        case 'makedirectory'
            makedirectory = varargin{i+1};
        otherwise
            error(['Unknown switch ', varargin{i},'!']) ;
    end