www.gusucode.com > 声音的处理有:LPC,FFT,共振峰,频谱源码程序 > siganlandsystemusingMatlab/SSUM/models/modelexpogui.m

    function varargout = modelexpogui(varargin)
% MODELEXPOGUI M-file for modelexpogui.fig
%      MODELEXPOGUI, by itself, creates a new MODELEXPOGUI or raises the existing
%      singleton*.
%
%      H = MODELEXPOGUI returns the handle to a new MODELEXPOGUI or the handle to
%      the existing singleton*.
%
%      MODELEXPOGUI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MODELEXPOGUI.M with the given input arguments.
%
%      MODELEXPOGUI('Property','Value',...) creates a new MODELEXPOGUI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before modelexpogui_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to modelexpogui_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help modelexpogui

% Last Modified by GUIDE v2.5 14-Aug-2004 13:53:11

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @modelexpogui_OpeningFcn, ...
                   'gui_OutputFcn',  @modelexpogui_OutputFcn, ...
                   'gui_LayoutFcn',  @modelexpogui_LayoutFcn, ...
                   'gui_Callback',   []);
if nargin & isstr(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end

% End initialization code - DO NOT EDIT

% --- Executes just before modelexpogui is made visible.
function modelexpogui_OpeningFcn(hObject, eventdata, handles, varargin)
	handles.output = hObject;
	guidata(hObject, handles);
	set(gcf,'UserData',handles);
	modelexpofn;

if (nargin > 5)
    datastruct = varargin;
    modelexpofn('readinput',datastruct);
end

% --- Outputs from this function are returned to the command line.
function varargout = modelexpogui_OutputFcn(hObject, eventdata, handles)
	varargout{1} = handles.output;

% --------------------------------------------------------------------
function FileMenu_Callback(hObject, eventdata, handles)

% --------------------------------------------------------------------
function OpenMenuItem_Callback(hObject, eventdata, handles)
	modelexpofn 'load';

% --------------------------------------------------------------------
function PrintMenuItem_Callback(hObject, eventdata, handles)
	modelexpofn 'print';

% --------------------------------------------------------------------
function CloseMenuItem_Callback(hObject, eventdata, handles)
	modelexpofn 'close';

% --- Executes on button press in inverse.
function inverse_Callback(hObject, eventdata, handles)
	modelexpofn 'inverse';

% --- Executes on button press in print.
function print_Callback(hObject, eventdata, handles)
	modelexpofn 'print';

% --- Executes during object creation, after setting all properties.
function imgsize_CreateFcn(hObject, eventdata, handles)
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function imgsize_Callback(hObject, eventdata, handles)
	val = floor(str2double(get(hObject,'String')));
	if val < 2,
		val = 2;
	end
	set(hObject,'String',num2str(val));

% --- Executes on button press in draw.
function draw_Callback(hObject, eventdata, handles)
	modelexpofn 'draw';

% --- Executes during object creation, after setting all properties.
function p_CreateFcn(hObject, eventdata, handles)
% hObject    handle to p (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function p_Callback(hObject, eventdata, handles)
	val = str2double(get(hObject,'String'));
	if val < 0,
		val = 0;
	elseif val > 1,
		val = 1;
	end
	set(hObject,'String',num2str(val));

% --------------------------------------------------------------------
function save_Callback(hObject, eventdata, handles)
	modelexpofn 'save';

% --- Executes during object creation, after setting all properties.
function q_CreateFcn(hObject, eventdata, handles)
% hObject    handle to q (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function q_Callback(hObject, eventdata, handles)
	val = str2double(get(hObject,'String'));
	if val < 0,
		val = 0;
	elseif val > 1,
		val = 1;
	end
	set(hObject,'String',num2str(val));


% --- Executes on button press in animate.
function animate_Callback(hObject, eventdata, handles)


% --- Executes on button press in twostate.
function twostate_Callback(hObject, eventdata, handles)
	if get(hObject,'Value')
		set(handles.ar,'Value',0);
		set(handles.us,'Value',0);
	end

% --- Executes on button press in ar.
function ar_Callback(hObject, eventdata, handles)
	if get(hObject,'Value')
		set(handles.twostate,'Value',0);
		set(handles.us,'Value',0);
	end

% --- Executes during object creation, after setting all properties.
function alpha_CreateFcn(hObject, eventdata, handles)
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function alpha_Callback(hObject, eventdata, handles)
	val = str2double(get(hObject,'String'));
	if val < 0,
		val = 0;
	elseif val > 1,
		%val = 1;
	end
	set(hObject,'String',num2str(val));


% --- Executes during object creation, after setting all properties.
function std_CreateFcn(hObject, eventdata, handles)
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function std_Callback(hObject, eventdata, handles)
	val = str2double(get(hObject,'String'));
	set(hObject,'String',num2str(abs(val)));


% --- Executes on button press in scale.
function scale_Callback(hObject, eventdata, handles)
	modelexpofn 'scale';


% --- Executes on button press in us.
function us_Callback(hObject, eventdata, handles)
% hObject    handle to us (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of us
	if get(hObject,'Value')
		set(handles.ar,'Value',0);
		set(handles.twostate,'Value',0);
	end


% --- Executes during object creation, after setting all properties.
function us_a_CreateFcn(hObject, eventdata, handles)
% hObject    handle to us_a (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function us_a_Callback(hObject, eventdata, handles)
% hObject    handle to us_a (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of us_a as text
%        str2double(get(hObject,'String')) returns contents of us_a as a double


% --- Executes during object creation, after setting all properties.
function us_std_CreateFcn(hObject, eventdata, handles)
% hObject    handle to us_std (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function us_std_Callback(hObject, eventdata, handles)
	%If uniform is selected make inactive

% --- Executes on button press in us_scale.
function us_scale_Callback(hObject, eventdata, handles)
	modelexpofn 'scale';


% --- Executes during object creation, after setting all properties.
function distribution_CreateFcn(hObject, eventdata, handles)
% hObject    handle to distribution (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on selection change in distribution.
function distribution_Callback(hObject, eventdata, handles)
% hObject    handle to distribution (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns distribution contents as cell array
%        contents{get(hObject,'Value')} returns selected item from distribution
	contents = get(hObject,'String');
	switch lower(contents{get(hObject,'Value')}),
		case 'uniform'
			set(handles.us_std,'Enable','off');
		otherwise
			set(handles.us_std,'Enable','on');
	end


% --- Executes during object creation, after setting all properties.
function bits_CreateFcn(hObject, eventdata, handles)
% hObject    handle to bits (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function bits_Callback(hObject, eventdata, handles)
	bits = str2num(get(handles.bits,'String'));
	if bits < 1
		bits = 1;
	end
	set(handles.bits,'String',num2str(round(bits)));


% --------------------------------------------------------------------
function help_Callback(hObject, eventdata, handles)
% hObject    handle to help (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
	modelexpofn 'help';




% --- Creates and returns a handle to the GUI figure. 
function h1 = modelexpogui_LayoutFcn(policy)
% policy - create a new figure or use a singleton. 'new' or 'reuse'.

persistent hsingleton;
if strcmpi(policy, 'reuse') & ishandle(hsingleton)
    h1 = hsingleton;
    return;
end

h1 = figure(...
'Units','characters',...
'Color',[0.925490196078431 0.913725490196078 0.847058823529412],...
'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],...
'IntegerHandle','off',...
'InvertHardcopy',get(0,'defaultfigureInvertHardcopy'),...
'MenuBar','none',...
'Name','modelexpo',...
'NumberTitle','off',...
'PaperOrientation','landscape',...
'PaperPosition',get(0,'defaultfigurePaperPosition'),...
'PaperSize',[11 8.5],...
'Pointer','crosshair',...
'Position',[128.6 37.5384615384615 70.2 16.7692307692308],...
'Renderer',get(0,'defaultfigureRenderer'),...
'RendererMode','manual',...
'Resize','off',...
'HandleVisibility','callback',...
'Tag','modelexpo_fig',...
'UserData',zeros(1,0));

setappdata(h1, 'GUIDEOptions', struct(...
'active_h', [], ...
'taginfo', struct(...
'figure', 2, ...
'axes', 6, ...
'pushbutton', 15, ...
'popupmenu', 10, ...
'listbox', 2, ...
'text', 26, ...
'slider', 2, ...
'checkbox', 11, ...
'radiobutton', 8, ...
'frame', 5, ...
'edit', 14), ...
'override', 1, ...
'release', 13, ...
'resize', 'none', ...
'accessibility', 'callback', ...
'mfile', 1, ...
'callbacks', 1, ...
'singleton', 1, ...
'syscolorfig', 1, ...
'lastSavedFile', 'C:\Documents and Settings\Bob\Desktop\SSUM_WIN\models\modelexpo.m', ...
'blocking', 0));


h2 = uimenu(...
'Parent',h1,...
'Callback','modelexpogui(''FileMenu_Callback'',gcbo,[],guidata(gcbo))',...
'Label','File',...
'Tag','FileMenu');

h3 = uimenu(...
'Parent',h2,...
'Callback','modelexpogui(''save_Callback'',gcbo,[],guidata(gcbo))',...
'Label','Save Image',...
'Tag','save');

h4 = uimenu(...
'Parent',h2,...
'Callback','modelexpogui(''print_Callback'',gcbo,[],guidata(gcbo))',...
'Label','Print',...
'Tag','print');

h5 = uimenu(...
'Parent',h2,...
'Callback','modelexpogui(''CloseMenuItem_Callback'',gcbo,[],guidata(gcbo))',...
'Label','Close',...
'Separator','on',...
'Tag','CloseMenuItem');

h6 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[2 4.38461538461539 20.4 10],...
'String',{ '' },...
'Style','frame',...
'Tag','frame1',...
'UserData',zeros(1,0));


h7 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','modelexpogui(''imgsize_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[10.6 1.38461538461538 7 1.46153846153846],...
'String','256',...
'Style','edit',...
'CreateFcn','modelexpogui(''imgsize_CreateFcn'',gcbo,[],guidata(gcbo))',...
'Tag','imgsize',...
'UserData',zeros(1,0));


h8 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'FontSize',10,...
'HorizontalAlignment','right',...
'ListboxTop',0,...
'Position',[0.4 1.07692307692308 8.8 1.76923076923077],...
'String','Size',...
'Style','text',...
'Tag','text11',...
'UserData',zeros(1,0));


h9 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','modelexpogui(''draw_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[19.6 1.38461538461538 8 1.46153846153846],...
'String','Draw',...
'Tag','draw',...
'UserData',zeros(1,0));


h10 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','modelexpogui(''p_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[10.6 11.8461538461538 7 1.46153846153846],...
'String','0.5',...
'Style','edit',...
'CreateFcn','modelexpogui(''p_CreateFcn'',gcbo,[],guidata(gcbo))',...
'Tag','p',...
'UserData',zeros(1,0));


h11 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'FontSize',12,...
'HorizontalAlignment','right',...
'ListboxTop',0,...
'Position',[5.6 12 3 1.46153846153846],...
'String','p',...
'Style','text',...
'Tag','text15',...
'UserData',zeros(1,0));


h12 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','modelexpogui(''q_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[10.6 9.61538461538462 7 1.46153846153846],...
'String','0.5',...
'Style','edit',...
'CreateFcn','modelexpogui(''q_CreateFcn'',gcbo,[],guidata(gcbo))',...
'Tag','q',...
'UserData',zeros(1,0));


h13 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'FontSize',12,...
'HorizontalAlignment','right',...
'ListboxTop',0,...
'Position',[5.6 9.76923076923077 3 1.46153846153846],...
'String','q',...
'Style','text',...
'Tag','text16',...
'UserData',zeros(1,0));


h14 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','modelexpogui(''animate_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[30 1.38461538461538 12 1.46153846153846],...
'String','Animate',...
'Style','checkbox',...
'Tag','animate',...
'UserData',zeros(1,0));


h15 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[25.2 4.38461538461539 20.4 10],...
'String',{ '' },...
'Style','frame',...
'Tag','frame3',...
'UserData',zeros(1,0));


h16 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'FontSize',10,...
'ListboxTop',0,...
'Position',[22.8 14.3846153846154 24.8 1.53846153846154],...
'String','Auto-Regression',...
'Style','text',...
'Tag','text18',...
'UserData',zeros(1,0));


h17 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'FontSize',10,...
'ListboxTop',0,...
'Position',[2.4 14.4615384615385 19.2 1.46153846153846],...
'String','2-State',...
'Style','text',...
'Tag','text19',...
'UserData',zeros(1,0));


h18 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','modelexpogui(''twostate_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[3.8 5.53846153846154 3 1.46153846153846],...
'Style','checkbox',...
'Value',1,...
'Tag','twostate',...
'UserData',zeros(1,0));


h19 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','modelexpogui(''ar_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[27.2 5.53846153846154 3 1.46153846153846],...
'Style','checkbox',...
'Tag','ar',...
'UserData',zeros(1,0));


h20 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','modelexpogui(''alpha_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[32.6 11.7692307692308 7 1.46153846153846],...
'String','0.5',...
'Style','edit',...
'CreateFcn','modelexpogui(''alpha_CreateFcn'',gcbo,[],guidata(gcbo))',...
'Tag','alpha',...
'UserData',zeros(1,0));


h21 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'FontSize',12,...
'HorizontalAlignment','right',...
'ListboxTop',0,...
'Position',[27.8 12 3 1.46153846153846],...
'String','a',...
'Style','text',...
'Tag','dsd',...
'UserData',zeros(1,0));


h22 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','modelexpogui(''std_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[32.6 9.30769230769231 7 1.46153846153846],...
'String','0.5',...
'Style','edit',...
'CreateFcn','modelexpogui(''std_CreateFcn'',gcbo,[],guidata(gcbo))',...
'Tag','std',...
'UserData',zeros(1,0));


h23 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'FontSize',12,...
'HorizontalAlignment','right',...
'ListboxTop',0,...
'Position',[26 9.46153846153846 5 1.46153846153846],...
'String','std',...
'Style','text',...
'Tag','das',...
'UserData',zeros(1,0));


h24 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','modelexpogui(''scale_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[32.6 5.53846153846154 12 1.46153846153846],...
'String','Scale',...
'Style','checkbox',...
'Tag','scale',...
'UserData',zeros(1,0));


h25 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[48.6 1.30769230769231 20.4 13],...
'String',{ '' },...
'Style','frame',...
'Tag','frame4',...
'UserData',zeros(1,0));


h26 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'FontSize',10,...
'ListboxTop',0,...
'Position',[47.2 14.3846153846154 22.8 1.53846153846154],...
'String','User-Specified',...
'Style','text',...
'Tag','text22',...
'UserData',zeros(1,0));


h27 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','modelexpogui(''us_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[50.6 2.30769230769231 3 1.46153846153846],...
'Style','checkbox',...
'Tag','us',...
'UserData',zeros(1,0));


h28 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','modelexpogui(''us_a_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[55.6 11.7692307692308 7 1.46153846153846],...
'String','0',...
'Style','edit',...
'CreateFcn','modelexpogui(''us_a_CreateFcn'',gcbo,[],guidata(gcbo))',...
'Tag','us_a',...
'UserData',zeros(1,0));


h29 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'FontSize',12,...
'HorizontalAlignment','right',...
'ListboxTop',0,...
'Position',[51 12 3 1.46153846153846],...
'String','a',...
'Style','text',...
'Tag','text23',...
'UserData',zeros(1,0));


h30 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','modelexpogui(''us_std_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[55.6 9.30769230769231 7 1.46153846153846],...
'String','0.5',...
'Style','edit',...
'CreateFcn','modelexpogui(''us_std_CreateFcn'',gcbo,[],guidata(gcbo))',...
'Tag','us_std',...
'UserData',zeros(1,0));


h31 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'FontSize',12,...
'HorizontalAlignment','right',...
'ListboxTop',0,...
'Position',[49.4 9.46153846153846 5 1.46153846153846],...
'String','std',...
'Style','text',...
'Tag','text24',...
'UserData',zeros(1,0));


h32 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','modelexpogui(''us_scale_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[53.8 2.30769230769231 12 1.46153846153846],...
'String','Scale',...
'Style','checkbox',...
'Value',1,...
'Tag','us_scale',...
'UserData',zeros(1,0));


h33 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','modelexpogui(''distribution_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[50.4 6.53846153846154 14.6 1.46153846153846],...
'String',{ 'Gaussian' 'Uniform' },...
'Style','popupmenu',...
'Value',1,...
'CreateFcn','modelexpogui(''distribution_CreateFcn'',gcbo,[],guidata(gcbo))',...
'Tag','distribution',...
'UserData',zeros(1,0));


h34 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','modelexpogui(''bits_Callback'',gcbo,[],guidata(gcbo))',...
'CData',zeros(1,0),...
'FontName','default',...
'ListboxTop',0,...
'Position',[55.6 4.53846153846154 7 1.46153846153846],...
'String','1',...
'Style','edit',...
'CreateFcn','modelexpogui(''bits_CreateFcn'',gcbo,[],guidata(gcbo))',...
'Tag','bits',...
'UserData',zeros(1,0));


h35 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'CData',zeros(1,0),...
'FontName','default',...
'FontSize',10,...
'HorizontalAlignment','right',...
'ListboxTop',0,...
'Position',[49.8 4.46153846153846 5 1.46153846153846],...
'String','bits',...
'Style','text',...
'Tag','text25',...
'UserData',zeros(1,0));


h36 = uimenu(...
'Parent',h1,...
'Callback','modelexpogui(''help_Callback'',gcbo,[],guidata(gcbo))',...
'Label','Help',...
'Tag','help');


hsingleton = h1;


% --- Handles default GUIDE GUI creation and callback dispatch
function varargout = gui_mainfcn(gui_State, varargin)


%   GUI_MAINFCN provides these command line APIs for dealing with GUIs
%
%      MODELEXPOGUI, by itself, creates a new MODELEXPOGUI or raises the existing
%      singleton*.
%
%      H = MODELEXPOGUI returns the handle to a new MODELEXPOGUI or the handle to
%      the existing singleton*.
%
%      MODELEXPOGUI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MODELEXPOGUI.M with the given input arguments.
%
%      MODELEXPOGUI('Property','Value',...) creates a new MODELEXPOGUI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before untitled_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to untitled_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".

%   Copyright 1984-2002 The MathWorks, Inc.
%   $Revision: 1.4 $ $Date: 2002/05/31 21:44:31 $

gui_StateFields =  {'gui_Name'
                    'gui_Singleton'
                    'gui_OpeningFcn'
                    'gui_OutputFcn'
                    'gui_LayoutFcn'
                    'gui_Callback'};
gui_Mfile = '';
for i=1:length(gui_StateFields)
    if ~isfield(gui_State, gui_StateFields{i})
        error('Could not find field %s in the gui_State struct in GUI M-file %s', gui_StateFields{i}, gui_Mfile);        
    elseif isequal(gui_StateFields{i}, 'gui_Name')
        gui_Mfile = [getfield(gui_State, gui_StateFields{i}), '.m'];
    end
end

numargin = length(varargin);

if numargin == 0
    % MODELEXPOGUI
    % create the GUI
    gui_Create = 1;
elseif numargin > 3 & ischar(varargin{1}) & ishandle(varargin{2})
    % MODELEXPOGUI('CALLBACK',hObject,eventData,handles,...)
    gui_Create = 0;
else
    % MODELEXPOGUI(...)
    % create the GUI and hand varargin to the openingfcn
    gui_Create = 1;
end

if gui_Create == 0
    varargin{1} = gui_State.gui_Callback;
    if nargout
        [varargout{1:nargout}] = feval(varargin{:});
    else
        feval(varargin{:});
    end
else
    if gui_State.gui_Singleton
        gui_SingletonOpt = 'reuse';
    else
        gui_SingletonOpt = 'new';
    end
    
    % Open fig file with stored settings.  Note: This executes all component
    % specific CreateFunctions with an empty HANDLES structure.
    
    % Do feval on layout code in m-file if it exists
    if ~isempty(gui_State.gui_LayoutFcn)
        gui_hFigure = feval(gui_State.gui_LayoutFcn, gui_SingletonOpt);
    else
        gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt);            
        % If the figure has InGUIInitialization it was not completely created
        % on the last pass.  Delete this handle and try again.
        if isappdata(gui_hFigure, 'InGUIInitialization')
            delete(gui_hFigure);
            gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt);            
        end
    end
    
    % Set flag to indicate starting GUI initialization
    setappdata(gui_hFigure,'InGUIInitialization',1);

    % Fetch GUIDE Application options
    gui_Options = getappdata(gui_hFigure,'GUIDEOptions');
    
    if ~isappdata(gui_hFigure,'GUIOnScreen')
        % Adjust background color
        if gui_Options.syscolorfig 
            set(gui_hFigure,'Color', get(0,'DefaultUicontrolBackgroundColor'));
        end

        % Generate HANDLES structure and store with GUIDATA
        guidata(gui_hFigure, guihandles(gui_hFigure));
    end
    
    % If user specified 'Visible','off' in p/v pairs, don't make the figure
    % visible.
    gui_MakeVisible = 1;
    for ind=1:2:length(varargin)
        if length(varargin) == ind
            break;
        end
        len1 = min(length('visible'),length(varargin{ind}));
        len2 = min(length('off'),length(varargin{ind+1}));
        if ischar(varargin{ind}) & ischar(varargin{ind+1}) & ...
                strncmpi(varargin{ind},'visible',len1) & len2 > 1
            if strncmpi(varargin{ind+1},'off',len2)
                gui_MakeVisible = 0;
            elseif strncmpi(varargin{ind+1},'on',len2)
                gui_MakeVisible = 1;
            end
        end
    end
    
    % Check for figure param value pairs
    for index=1:2:length(varargin)
        if length(varargin) == index
            break;
        end
        try, set(gui_hFigure, varargin{index}, varargin{index+1}), catch, break, end
    end

    % If handle visibility is set to 'callback', turn it on until finished
    % with OpeningFcn
    gui_HandleVisibility = get(gui_hFigure,'HandleVisibility');
    if strcmp(gui_HandleVisibility, 'callback')
        set(gui_hFigure,'HandleVisibility', 'on');
    end
    
    feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
    
    if ishandle(gui_hFigure)
        % Update handle visibility
        set(gui_hFigure,'HandleVisibility', gui_HandleVisibility);
        
        % Make figure visible
        if gui_MakeVisible
            set(gui_hFigure, 'Visible', 'on')
            if gui_Options.singleton 
                setappdata(gui_hFigure,'GUIOnScreen', 1);
            end
        end

        % Done with GUI initialization
        rmappdata(gui_hFigure,'InGUIInitialization');
    end
    
    % If handle visibility is set to 'callback', turn it on until finished with
    % OutputFcn
    if ishandle(gui_hFigure)
        gui_HandleVisibility = get(gui_hFigure,'HandleVisibility');
        if strcmp(gui_HandleVisibility, 'callback')
            set(gui_hFigure,'HandleVisibility', 'on');
        end
        gui_Handles = guidata(gui_hFigure);
    else
        gui_Handles = [];
    end
    
    if nargout
        [varargout{1:nargout}] = feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles);
    else
        feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles);
    end
    
    if ishandle(gui_hFigure)
        set(gui_hFigure,'HandleVisibility', gui_HandleVisibility);
    end
end    

function gui_hFigure = local_openfig(name, singleton)
if nargin('openfig') == 3 
    gui_hFigure = openfig(name, singleton, 'auto');
else
    % OPENFIG did not accept 3rd input argument until R13,
    % toggle default figure visible to prevent the figure
    % from showing up too soon.
    gui_OldDefaultVisible = get(0,'defaultFigureVisible');
    set(0,'defaultFigureVisible','off');
    gui_hFigure = openfig(name, singleton);
    set(0,'defaultFigureVisible',gui_OldDefaultVisible);
end