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: offset2time.m
    path of file: ./repos/spm/external/fieldtrip/utilities/private
    
    the code of the file until where you have to start completion: function time = offset2time(offset, fsample, nsamples)


    
function time = offset2time(offset, fsample, nsamples)

% OFFSET2TIME converts the offset of a trial definition into a time-axis
% according to the definition from DEFINETRIAL
%
% Use as
%   [time] = offset2time(offset, fsample, nsamples)
%
% The trialdefinition "trl" is an Nx3 matrix. The first column contains
% the sample-indices of the begin of the trial relative to the begin
% of the raw data , the second column contains the sample_indices of
% the end