% Copyright (C) 2003 Michel Juillard
%
% set
function set_shocks(flag,k,ivar,values)
  global ex_ exe_
  
  n = size(ex_,1);
  if k(end) > n
    ex_ = [ex_; ones(k(end)-n,1)*exe_'];
  end
  
  if flag == 0
    ex_(k,ivar) = ones(length(k),1).*values;
  else
    ex_(k,ivar) = ex_(k,ivar).*values;
  end

  % 05/29/03 MJ