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_regressor.m
    path of file: ./repos/malini/Codes/deconvolution - model/spm8/marsbar-0.44/@mardo_2
    
    the code of the file until where you have to start completion: function [X, dt] = event_regressor(D, e_spec, dur)
% method gets estimated regressor for single event 

    
function [X, dt] = event_regressor(D, e_spec, dur)
% method gets estimated regressor for single event 
% FORMAT [X dt] = event_regressor(D, e_spec, dur)
%
% D          - design object
% e_spec     - event specification (see event_fitted for details)
% dur        - event duration in seconds (default = 0)
% 
% Returns
% X          - event regressor for single event 
%              (one column per basis function used to model event)
% dt         - time units (seconds per row in X)
%
% $Id$
  
if nargin < 2
  error('Need design and event spec');
end