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

📄 compandexpogui.m

📁 非常好的数字处理教程
💻 M
📖 第 1 页 / 共 3 页
字号:
function varargout = compandexpogui(varargin)% COMPANDEXPOGUI M-file for compandexpogui.fig%      COMPANDEXPOGUI, by itself, creates a new COMPANDEXPOGUI or raises the existing%      singleton*.%%      H = COMPANDEXPOGUI returns the handle to a new COMPANDEXPOGUI or the handle to%      the existing singleton*.%%      COMPANDEXPOGUI('CALLBACK',hObject,eventData,handles,...) calls the local%      function named CALLBACK in COMPANDEXPOGUI.M with the given input arguments.%%      COMPANDEXPOGUI('Property','Value',...) creates a new COMPANDEXPOGUI or raises the%      existing singleton*.  Starting from the left, property value pairs are%      applied to the GUI before compandexpogui_OpeningFunction gets called.  An%      unrecognized property name or invalid value makes property application%      stop.  All inputs are passed to compandexpogui_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 compandexpogui% Last Modified by GUIDE v2.5 01-Dec-2005 15:34:18% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name',       mfilename, ...                   'gui_Singleton',  gui_Singleton, ...                   'gui_OpeningFcn', @compandexpogui_OpeningFcn, ...                   'gui_OutputFcn',  @compandexpogui_OutputFcn, ...                   'gui_LayoutFcn',  @compandexpogui_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 compandexpogui is made visible.function compandexpogui_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject    handle to figure% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% varargin   command line arguments to compandexpogui (see VARARGIN)% Choose default command line output for compandexpogui	handles.output = hObject;	guidata(hObject, handles);	set(gcf,'UserData',handles);	compandexpofn;	if (nargin > 3)		datastruct = varargin{1};		compandexpofn('readinput',datastruct);	end% --- Outputs from this function are returned to the command line.function varargout = compandexpogui_OutputFcn(hObject, eventdata, handles)	varargout{1} = handles.output;% --------------------------------------------------------------------function FileMenu_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function PrintMenuItem_Callback(hObject, eventdata, handles)	compandexpofn 'print';% --------------------------------------------------------------------function CloseMenuItem_Callback(hObject, eventdata, handles)	compandexpofn 'close';% --------------------------------------------------------------------function apply_Callback(hObject, eventdata, handles)% hObject    handle to apply (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)		compandexpofn 'apply';% --------------------------------------------------------------------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)    compandexpofn 'help';% --- Executes when compandexpogui_fig window is resized.function compandexpogui_fig_ResizeFcn(hObject, eventdata, handles)% hObject    handle to compandexpogui_fig (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)    compandexpofn 'resize';% --- Executes on selection change in pdfmenu.function pdfmenu_Callback(hObject, eventdata, handles)% hObject    handle to pdfmenu (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 pdfmenu contents as cell array%        contents{get(hObject,'Value')} returns selected item from pdfmenu		compandexpofn 'pdfupdate';% --- Executes during object creation, after setting all properties.function pdfmenu_CreateFcn(hObject, eventdata, handles)% hObject    handle to pdfmenu (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');endfunction levels_Callback(hObject, eventdata, handles)% hObject    handle to levels (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 levels as text%        str2double(get(hObject,'String')) returns contents of levels as a double				test = floor(abs(str2num(get(hObject,'String'))));		if test > 0			set(hObject,'String',num2str(test));		else			set(hObject,'String',num2str(1));		end		compandexpofn	'sqnrupdate';% --- Executes during object creation, after setting all properties.function levels_CreateFcn(hObject, eventdata, handles)% hObject    handle to levels (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');end% --- Executes on button press in play_orig.function play_orig_Callback(hObject, eventdata, handles)% hObject    handle to play_orig (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)		compandexpofn 'play_orig';% --- Executes on button press in play_quant.function play_quant_Callback(hObject, eventdata, handles)% hObject    handle to play_quant (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)		compandexpofn 'play_quant';function maxx_Callback(hObject, eventdata, handles)% hObject    handle to maxx (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 maxx as text%        str2double(get(hObject,'String')) returns contents of maxx as a double		test = abs(str2num(get(hObject,'String')));		set(hObject,'String',num2str(test));			compandexpofn	'sqnrupdate';% --- Executes during object creation, after setting all properties.function maxx_CreateFcn(hObject, eventdata, handles)% hObject    handle to maxx (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');endfunction mu_Callback(hObject, eventdata, handles)% hObject    handle to mu (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 mu as text%        str2double(get(hObject,'String')) returns contents of mu as a double		test = abs(str2num(get(hObject,'String')));		set(hObject,'String',num2str(test));			compandexpofn	'sqnrupdate';% --- Executes during object creation, after setting all properties.function mu_CreateFcn(hObject, eventdata, handles)% hObject    handle to mu (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');end% --- Executes on button press in holdon.function holdon_Callback(hObject, eventdata, handles)% hObject    handle to holdon (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 holdon% --- Executes on selection change in compmenu.function compmenu_Callback(hObject, eventdata, handles)% hObject    handle to compmenu (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 compmenu contents as cell array%        contents{get(hObject,'Value')} returns selected item from compmenu		contents = get(hObject,'String');		switch lower(contents{get(hObject,'Value')})			case 'mu-law'				set(handles.compstring,'String','mu');			case 'a-law'				set(handles.compstring,'String','A');		end		compandexpofn	'sqnrupdate';% --- Executes during object creation, after setting all properties.function compmenu_CreateFcn(hObject, eventdata, handles)% hObject    handle to compmenu (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');end% --- Executes on selection change in quantmenu.function quantmenu_Callback(hObject, eventdata, handles)% hObject    handle to quantmenu (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 quantmenu contents as cell array%        contents{get(hObject,'Value')} returns selected item from quantmenu		compandexpofn	'sqnrupdate';% --- Executes during object creation, after setting all properties.function quantmenu_CreateFcn(hObject, eventdata, handles)% hObject    handle to quantmenu (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');end% --- Creates and returns a handle to the GUI figure. function h1 = compandexpogui_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;endappdata = [];appdata.GUIDEOptions = struct(...    'active_h', [], ...    'taginfo', struct(...    'figure', 2, ...    'axes', 8, ...    'pushbutton', 14, ...    'popupmenu', 10, ...    'listbox', 2, ...    'text', 19, ...    'slider', 4, ...    'checkbox', 7, ...    'radiobutton', 5, ...    'edit', 5), ...    'override', 1, ...    'release', 13, ...    'resize', 'simple', ...    'accessibility', 'callback', ...    'mfile', 1, ...    'callbacks', 1, ...    'singleton', 1, ...    'syscolorfig', 1, ...    'lastSavedFile', '/Users/bobsturm/SSUM/quantization/compandexpo/compandexpogui.m', ...    'blocking', 0);appdata.lastValidTag = 'compandexpo_fig';appdata.GUIDELayoutEditor = [];h1 = figure(...'Units','characters',...'Color',[0.701960784313725 0.701960784313725 0.701960784313725],...'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],...'DockControls','off',...'IntegerHandle','off',...'InvertHardcopy',get(0,'defaultfigureInvertHardcopy'),...'MenuBar','none',...'Name','Companding Explorer',...'NumberTitle','off',...'PaperOrientation','landscape',...'PaperPosition',get(0,'defaultfigurePaperPosition'),...'PaperSize',[11 8.5],...'Pointer','crosshair',...'Position',[1 25.6858974358974 146.333333333333 45.0833333333333],...'Renderer',get(0,'defaultfigureRenderer'),...'RendererMode','manual',...'HandleVisibility','callback',...'Tag','compandexpo_fig',...'UserData',[],...'Behavior',get(0,'defaultfigureBehavior'),...'Visible','on',...'CreateFcn', {@local_CreateFcn, '', appdata} );appdata = [];appdata.lastValidTag = 'FileMenu';h2 = uimenu(...'Parent',h1,...'Callback','compandexpogui(''FileMenu_Callback'',gcbo,[],guidata(gcbo))',...'Label','File',...'Tag','FileMenu',...'Behavior',get(0,'defaultuimenuBehavior'),...'CreateFcn', {@local_CreateFcn, '', appdata} );appdata = [];appdata.lastValidTag = 'CloseMenuItem';h3 = uimenu(...'Parent',h2,...'Callback','compandexpogui(''CloseMenuItem_Callback'',gcbo,[],guidata(gcbo))',...'Label','Close',...'Separator','on',...'Tag','CloseMenuItem',...'Behavior',get(0,'defaultuimenuBehavior'),...'CreateFcn', {@local_CreateFcn, '', appdata} );appdata = [];appdata.lastValidTag = 'help';h4 = uimenu(...'Parent',h1,...'Callback','compandexpogui(''help_Callback'',gcbo,[],guidata(gcbo))',...'Label','Help',...'Tag','help',...'Behavior',get(0,'defaultuimenuBehavior'),...'CreateFcn', {@local_CreateFcn, '', appdata} );appdata = [];appdata.lastValidTag = 'pdfmenu';h5 = uicontrol(...'Parent',h1,...'Units','characters',...'Callback','compandexpogui(''pdfmenu_Callback'',gcbo,[],guidata(gcbo))',...'FontSize',12,...'Position',[16.5 5.75 20 1.5],...'String',{  'Uniform'; 'Gaussian'; 'Laplacian'; 'Audio'; 'Audio Difference' },...'Style','popupmenu',...'Value',1,...'CreateFcn', {@local_CreateFcn, 'compandexpogui(''pdfmenu_CreateFcn'',gcbo,[],guidata(gcbo))', appdata} ,...'Tag','pdfmenu',...'Behavior',get(0,'defaultuicontrolBehavior'));appdata = [];appdata.lastValidTag = 'text10';h6 = uicontrol(...'Parent',h1,...'Units','characters',...'FontSize',12,...'HorizontalAlignment','right',...'Position',[2 5.66666666666667 13.3333333333333 1.5],...'String','Distribution',...'Style','text',...'Tag','text10',...'Behavior',get(0,'defaultuicontrolBehavior'),...'CreateFcn', {@local_CreateFcn, '', appdata} );appdata = [];appdata.lastValidTag = 'text13';h7 = uicontrol(...'Parent',h1,...'Units','characters',...'FontSize',12,...'HorizontalAlignment','right',...

⌨️ 快捷键说明

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