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: nmt_peaksearch.m
    path of file: ./repos/fieldtrip/contrib/nutmegtrip
    
    the code of the file until where you have to start completion: function [vox_idx, t_idx] = nmt_peaksearch(cfg)
% [vox_idx, t_idx] = nmt_peaksearch(cfg)
% cfg.time = single time point, or time range, or 'current'; if unspecified, search over time at specified voxel
% cfg.vox = find peak time at specified voxel, or 'current'; if unspecified, search over voxels at specified time

    
function [vox_idx, t_idx] = nmt_peaksearch(cfg)
% [vox_idx, t_idx] = nmt_peaksearch(cfg)
% cfg.time = single time point, or time range, or 'current'; if unspecified, search over time at specified voxel
% cfg.vox = find peak time at specified voxel, or 'current'; if unspecified, search over voxels at specified time
% cfg.peaktype = 'mag' (max magnitude, default) or 'max' or 'min'
% cfg.searchradius = minimum and maximum distance to search for peak

global st

if(~isfield(cfg,'peaktype'))
    cfg.peaktype = 'mag';
end