function option = setopt(opt_par,default);
%    option = setopt(opt_par,default); 
%
%    SETOPT can modify a default option vector with user specified options.
%
%    Input: 
%       opt_par : Users desired option vector
%       default : Program default option vector
%
%    Output: 
%       option : New option vector
%
%    Example:
%       opt_par = [1 2 3 4];
%       default = [1 1 1 1];
%       option = setopt(opt_par,default)
%       option = 1     2     3     4
%

%File Name: setopt.m
%Last Modification Date: 10/26/95	13:06:18
%Current Version: setopt.m	1.7
%File Creation Date: Thu Nov 11 10:40:22 1993
%Author: Jan Erik Odegard  <odegard@ece.rice.edu>
%
%Copyright: All software, documentation, and related files in this distribution
%           are Copyright (c) 1993  Rice University
%
%Permission is granted for use and non-profit distribution providing that this
%notice be clearly maintained. The right to distribute any portion for profit
%or as part of any commercial product is specifically reserved for the author.
%
%Change History:
%

if (nargin < 2) 
  error('You need two inputs');
end;
len = length(opt_par);
option = zeros(size(default));
option(1:len) = opt_par(1:len);
option = option + (option == 0).*default; 
