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: plx_orig_header.m
    path of file: ./repos/malini/Codes/deconvolution - model/spm8/external/fieldtrip/fileio/private
    
    the code of the file until where you have to start completion: function [ orig ] = plx_orig_header( fname )


    
function [ orig ] = plx_orig_header( fname )

% PLX_ORIG_HEADER Extracts the header informations of plx files using the
% Plexon Offline SDK, which is available from
% http://www.plexon.com/assets/downloads/sdk/ReadingPLXandDDTfilesinMatlab-mexw.zip
%
% Use as
%   [orig] = plx_orig_header(filename)
%
% Copyright (C) 2012 by Thomas Hartmann
%
% This code can be redistributed under the terms of the GPL version 3 or
% newer.

% get counts...
[tscounts, wfcounts, evcounts, contcounts] = plx_info(fname, 0);

orig.TSCounts = tscounts;
orig.WFCounts = wfcounts;

% get event channels...
[dummy, evchans] = plx_event_chanmap(fname);

orig.EVCounts = zeros(512, 1);

for i=1:length(evchans)
  try
    orig.EVCounts(evchans(i)+1) = evcounts(i);
  catch
  end