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: CEDS64ChanOffset.m
    path of file: ./repos/PsPM/src/Import/CEDS64ML
    
    the code of the file until where you have to start completion: %{
    Copyright (C) Cambridge Electronic Design Limited 2014
    Author: James Thompson
    Web: www.ced.co.uk email: james@ced.co.
    
function [ iOk, dOffsetOut ] = CEDS64ChanOffset( fhand, iChan, dOffsetIn )
%CEDS64CHANOFFSET Gets and sets the offset for a channel
%   [ iOk, dOffsetOut ] = CEDS64SetChanOffset( fhand, iChan, dOffsetIn )
%   fhand - An integer handle to an open file
%   iChan - A channel number
%   dOffsetIn - (Optional) The new offset as a double
%   Output
%   iOk - 0 if the offset was set correctly otherwise a negative error code
%   dOffsetOut - The old offset as a double

if (nargin == 2 || nargin == 3) % always get the offset
    dOffsetTemp = double(0.0);
    [ iOk, dOffsetOut ] = calllib('ceds64int', 'S64GetChanOffset', fhand, iChan, dOffsetTemp);
else
    iOk = -22;
end