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

📄 modelexpo.m

📁 非常好的数字处理教程
💻 M
字号:
function varargout = modelexpo(varargin)% MODELEXPO M-file for modelexpo.fig%      MODELEXPO, by itself, creates a new MODELEXPO or raises the existing%      singleton*.%%      H = MODELEXPO returns the handle to a new MODELEXPO or the handle to%      the existing singleton*.%%      MODELEXPO('CALLBACK',hObject,eventData,handles,...) calls the local%      function named CALLBACK in MODELEXPO.M with the given input arguments.%%      MODELEXPO('Property','Value',...) creates a new MODELEXPO or raises the%      existing singleton*.  Starting from the left, property value pairs are%      applied to the GUI before modelexpo_OpeningFunction gets called.  An%      unrecognized property name or invalid value makes property application%      stop.  All inputs are passed to modelexpo_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 modelexpo% Last Modified by GUIDE v2.5 24-Mar-2004 09:18:30% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name',       mfilename, ...                   'gui_Singleton',  gui_Singleton, ...                   'gui_OpeningFcn', @modelexpo_OpeningFcn, ...                   'gui_OutputFcn',  @modelexpo_OutputFcn, ...                   'gui_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 modelexpo is made visible.function modelexpo_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 = modelexpo_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';

⌨️ 快捷键说明

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