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: spm_get_ons.m
    path of file: ./repos/malini/Codes/deconvolution - model/spm8
    
    the code of the file until where you have to start completion: function [U] = spm_get_ons(SPM,s)
% Returns input [designed effects] structures
% FORMAT [U] = spm_get_ons(SPM,s)
%
% SPM   - SPM structure (see spm_fMRI_design.m)
% s     - session number
%
% U     - (1 x n)   struct array of (n) trial-specific structures
%
%   U(i).name   - cell of names for each input or cause
%   U(i).u      - inputs or stimulus function matrix
%   U(i).dt     - time bin (seconds)
%   U(i).ons    - onsets    (in SPM.xBF.UNITS)
%   U(i).dur    - durations (in SPM.xBF.UNITS)
%   U(i).P      - parameter struct.
%
%       U(i).P(p).name - parameter name
%       U(i).P(p).P    - parameter vector
%       U(i).P(p).h    - order of polynomial expansion
%       U(i).P(p).i    - sub-indices of u pertaining to P
%__________________________________________________________________________
%
% SLICE TIMING
%
% With longs TRs you may want to shift the regressors so that they are

    
function [U] = spm_get_ons(SPM,s)
% Returns input [designed effects] structures
% FORMAT [U] = spm_get_ons(SPM,s)
%
% SPM   - SPM structure (see spm_fMRI_design.m)
% s     - session number
%
% U     - (1 x n)   struct array of (n) trial-specific structures
%
%   U(i).name   - cell of names for each input or cause
%   U(i).u      - inputs or stimulus function matrix
%   U(i).dt     - time bin (seconds)
%   U(i).ons    - onsets    (in SPM.xBF.UNITS)
%   U(i).dur    - durations (in SPM.xBF.UNITS)
%   U(i).P      - parameter struct.
%
%       U(i).P(p).name - parameter name
%       U(i).P(p).P    - parameter vector
%       U(i).P(p).h    - order of polynomial expansion
%       U(i).P(p).i    - sub-indices of u pertaining to P
%__________________________________________________________________________
%
% SLICE TIMING
%
% With longs TRs you may want to shift the regressors so that they are
% aligned to a particular slice. This is effected by resetting the
% values of defaults.stats.fmri.t and defaults.stats.fmri.t0 in
% spm_defaults. 
% defaults.stats.fmri.t is the number of time-bins per scan used when
% building regressors. Onsets are defined in temporal units of scans
% starting at 0.
% defaults.stats.fmri.t0 is the first time-bin at which the regressors are
% resampled to coincide with data acquisition. If defaults.stats.fmri.t0
% is set to 1 then the regressors will be appropriate for the first slice.
% If you want to temporally realign the regressors so that they match
% responses in the middle slice then make defaults.stats.fmri.t0 =
% defaults.stats.fmri.t/2 (assuming there is a negligible gap between
% volume acquisitions).
% Default values are defaults.stats.fmri.t=16 and defaults.stats.fmri.t0=1.
%
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% Karl Friston
% $Id: spm_get_ons.m 4083 2010-10-08 10:31:55Z guillaume $


% time units
%--------------------------------------------------------------------------
k     = SPM.nscan(s);
T     = SPM.xBF.T;
dt    = SPM.xBF.dt;
try
    UNITS = SPM.xBF.UNITS;
catch
    UNITS = 'scans';
end