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: estimate.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 [marsD] = estimate(marsD, marsY, params)
% estimate method - estimates GLM for SPM2 model
%
% marsD           - SPM design object
% marsY           - MarsBaR data object or 2D data matrix
% params          - struct containing options, as fields
%                   redo_covar     - if 1, remodels covariance 
%                   redo_whitening - if 1, recalcalates whitening
%                   (by default, both are set to 1)
% 
% e.g.
% % Estimate model on design D and data Y, using original covariance and
% % whitening
% E = estimate(D, Y, struct('reco_covar', 0, ...
%                           'redo_whitening', 0);
%  
% $Id$

def_params = struct(...

    
function [marsD] = estimate(marsD, marsY, params)
% estimate method - estimates GLM for SPM2 model
%
% marsD           - SPM design object
% marsY           - MarsBaR data object or 2D data matrix
% params          - struct containing options, as fields
%                   redo_covar     - if 1, remodels covariance 
%                   redo_whitening - if 1, recalcalates whitening
%                   (by default, both are set to 1)
% 
% e.g.
% % Estimate model on design D and data Y, using original covariance and
% % whitening
% E = estimate(D, Y, struct('reco_covar', 0, ...
%                           'redo_whitening', 0);
%  
% $Id$

def_params = struct(...
    'redo_covar', 1, ...
    'redo_whitening', 1);

if nargin < 2
  error('Need data to estimate');
end