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: CEDS64ChanComment.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.uk, softhelp@ced.co.uk

    This file is part of CEDS64ML, a MATLAB interface to the SON64 library.

    CEDS64ML is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License
    
function [ iOk, sCommentOut ] = CEDS64ChanComment( fhand, iChan, sCommentIn )
%CEDS64CHANCOMMENT Gets and sets the comment for a channel
%   [ iOk, sCommentOut ] = CEDS64ChanComment( fhand, iChan {, sCommentIn} )
%   fhand - An integer handle to an open file
%   iChan - A channel number
%   sCommentIn - (Optional) A string containing the new comment
%   Output
%   iOk - 0 if the comment was set correctly otherwise a negative error code
%   sCommentOut - A string containing the old comment

if (nargin == 2 || nargin == 3) % always get the comment
    %step 1 find out how big the comment is
    dummystring = blanks(1);
    [iSize] = calllib('ceds64int', 'S64GetChanComment', fhand, iChan, dummystring, -1);
    %step 2 create a string buffer of the correct size
    stringptr = blanks(iSize+1);
    [iOk, sCommentOut] = calllib('ceds64int', 'S64GetChanComment', fhand, iChan, stringptr, 0);
else
    iOk = -22;
end