function varargout = randomizer(varargin)
%   This software is protected by german copyright and international treaties.             
%   Copyright 2004 Markus Junghöfer & Peter Peyk. All Rights Reserved.                     
%                                                                                          
%   THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE        
%   NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO,    
%   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE    
%   OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
%   TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT,       
%   INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE      
%   OR DOCUMENTATION.                                                                      
% UNTITLED1 Application M-file for untitled1.fig
%    FIG = UNTITLED1 launch untitled1 GUI.
%    UNTITLED1('callback_name', ...) invoke the named callback.

% Last Modified by GUIDE v2.0 27-May-2003 07:57:31



if nargin == 0  % LAUNCH GUI
    
    global faktorstring stufenvec aktiverfaktor gradientcell...
    stufenvec anzahlwiederholungen ausschlussmat anzahlfaktoren...
    signallaenge uewktstatus whlstatus ausschlussstatus wiederholungsstatus faktorausschlussstatus...
    opimierungsstatus distmat wiederholungsvec blockcheckstatus blockstocheck
        
	faktorstring=cell(1,1);faktorstring{1}='faktor1';stufenvec=zeros(1);
	aktiverfaktor=1;gradientcell=cell(1,1);widmat=[];ausschlussmat=[];
	uewktstatus = 0;anzahlfaktoren = 1;
	
	faktorauswahl = findobj('tag','faktorauswahl');
	set(faktorauswahl,'String',faktorstring);
	fig = openfig('randomizer.fig','reuse');

	% Generate a structure of handles to pass to callbacks, and store it. 
	handles = guihandles(fig);
	guidata(fig, handles);

	if nargout > 0
		varargout{1} = fig;
	end

elseif ischar(varargin{1}) % INVOKE NAMED SUBFUNCTION OR CALLBACK
    
    global faktorstring stufenvec aktiverfaktor gradientcell...
    stufenvec anzahlwiederholungen ausschlussmat anzahlfaktoren...
    signallaenge uewktstatus whlstatus ausschlussstatus wiederholungsstatus faktorausschlussstatus...
    opimierungsstatus distmat wiederholungsvec blockcheckstatus blockstocheck
    
	try
		if (nargout)
			[varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard
		else
			feval(varargin{:}); % FEVAL switchyard
		end
	catch
		disp(lasterr);
	end

end
