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: event_x_fir.m
    path of file: ./repos/bspm/thirdparty/spm12/toolbox/marsbar-0.44/@mardo_2
    
    the code of the file until where you have to start completion: function Xn = event_x_fir(D, e_spec, bin_length, bin_no, opts)
% method to return FIR design matrix columns for sessi
    
function sf = sf_ones_ons(U, xBF, k)
% Return onsets with only 1s in start time bin for each event
  
ons   = U.ons;
T     = xBF.T;
dt    = xBF.dt;
switch xBF.UNITS
 case 'scans'
  TR = T*dt;
 case 'secs'
  TR = 1;
end