⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modelexpogui.m

📁 非常好的数字处理教程
💻 M
📖 第 1 页 / 共 3 页
字号:
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 EDITgui_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});endif 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'));endfunction 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'));endfunction 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'));endfunction 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'));endfunction 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'));endfunction 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'));endfunction 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'));endfunction 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'));endfunction 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'),...

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -