📄 quantexpogui.m
字号:
function varargout = quantexpogui(varargin)% QUANTEXPOGUI M-file for quantexpogui.fig% QUANTEXPOGUI, by itself, creates a new QUANTEXPOGUI or raises the existing% singleton*.%% H = QUANTEXPOGUI returns the handle to a new QUANTEXPOGUI or the handle to% the existing singleton*.%% QUANTEXPOGUI('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in QUANTEXPOGUI.M with the given input arguments.%% QUANTEXPOGUI('Property','Value',...) creates a new QUANTEXPOGUI or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before quantexpogui_OpeningFunction gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to quantexpogui_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 quantexpogui% Last Modified by GUIDE v2.5 01-Dec-2005 14:28:29% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @quantexpogui_OpeningFcn, ... 'gui_OutputFcn', @quantexpogui_OutputFcn, ... 'gui_LayoutFcn', @quantexpogui_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 quantexpogui is made visible.function quantexpogui_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 quantexpogui (see VARARGIN)% Choose default command line output for quantexpogui handles.output = hObject; guidata(hObject, handles); set(gcf,'UserData',handles); quantexpofn; if (nargin > 3) datastruct = varargin{1}; quantexpofn('readinput',datastruct); end% --- Outputs from this function are returned to the command line.function varargout = quantexpogui_OutputFcn(hObject, eventdata, handles) varargout{1} = handles.output;% --------------------------------------------------------------------function FileMenu_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function PrintMenuItem_Callback(hObject, eventdata, handles) quantexpofn 'print';% --------------------------------------------------------------------function CloseMenuItem_Callback(hObject, eventdata, handles) quantexpofn '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) quantexpofn '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) quantexpofn 'help';% --- Executes when quantexpogui_fig window is resized.function quantexpogui_fig_ResizeFcn(hObject, eventdata, handles)% hObject handle to quantexpogui_fig (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) quantexpofn '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 quantexpofn 'updateall';% --- 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 pdfvar_Callback(hObject, eventdata, handles)% hObject handle to pdfvar (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 pdfvar as text% str2double(get(hObject,'String')) returns contents of pdfvar as a double test = abs(str2num(get(hObject,'String'))); set(hObject,'String',num2str(test)); quantexpofn 'updateall';% --- Executes during object creation, after setting all properties.function pdfvar_CreateFcn(hObject, eventdata, handles)% hObject handle to pdfvar (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 nlevels_Callback(hObject, eventdata, handles)% hObject handle to nlevels (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 nlevels as text% str2double(get(hObject,'String')) returns contents of nlevels 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 quantexpofn 'updateall';% --- Executes during object creation, after setting all properties.function nlevels_CreateFcn(hObject, eventdata, handles)% hObject handle to nlevels (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 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 quantexpofn 'updateall';% --- 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% --- Executes on button press in printlevels.function printlevels_Callback(hObject, eventdata, handles)% hObject handle to printlevels (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) quantexpofn 'printlevels';% --- Executes on button press in showR.function showR_Callback(hObject, eventdata, handles)% hObject handle to showR (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 showR quantexpofn 'show';% --- Executes on button press in showL.function showL_Callback(hObject, eventdata, handles)% hObject handle to showL (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 showL quantexpofn 'show';% --- 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) quantexpofn '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) quantexpofn 'play_quant';% --- Executes on selection change in distmenu.function distmenu_Callback(hObject, eventdata, handles)% hObject handle to distmenu (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 distmenu contents as cell array% contents{get(hObject,'Value')} returns selected item from distmenu quantexpofn 'updateall';% --- Executes during object creation, after setting all properties.function distmenu_CreateFcn(hObject, eventdata, handles)% hObject handle to distmenu (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 = quantexpogui_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', 7, ... 'pushbutton', 14, ... 'popupmenu', 9, ... 'listbox', 2, ... 'text', 16, ... 'slider', 4, ... 'checkbox', 6, ... 'radiobutton', 5, ... 'edit', 3), ... 'override', 1, ... 'release', 13, ... 'resize', 'simple', ... 'accessibility', 'callback', ... 'mfile', 1, ... 'callbacks', 1, ... 'singleton', 1, ... 'syscolorfig', 1, ... 'lastSavedFile', '/Users/bobsturm/SSUM/quantization/quantexpo/quantexpogui.m', ... 'blocking', 0);appdata.lastValidTag = 'quantexpo_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','Quantization Explorer',...'NumberTitle','off',...'PaperOrientation','landscape',...'PaperPosition',get(0,'defaultfigurePaperPosition'),...'PaperSize',[11 8.5],...'Pointer','crosshair',...'Position',[1 24.9358974358974 158.666666666667 45.8333333333333],...'Renderer',get(0,'defaultfigureRenderer'),...'RendererMode','manual',...'HandleVisibility','callback',...'Tag','quantexpo_fig',...'UserData',[],...'Behavior',get(0,'defaultfigureBehavior'),...'Visible','on',...'CreateFcn', {@local_CreateFcn, '', appdata} );appdata = [];appdata.lastValidTag = 'FileMenu';h2 = uimenu(...'Parent',h1,...'Callback','quantexpogui(''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','quantexpogui(''CloseMenuItem_Callback'',gcbo,[],guidata(gcbo))',...'Label','Close',...'Separator','on',...'Tag','CloseMenuItem',...'Behavior',get(0,'defaultuimenuBehavior'),...'CreateFcn', {@local_CreateFcn, '', appdata} );appdata = [];appdata.lastValidTag = 'pdfplot';h4 = axes(...'Parent',h1,...'Units','characters',...'Position',[2 12.3333333333333 74.1666666666667 31.5],...'ALim',get(0,'defaultaxesALim'),...'ALimMode','manual',...'CameraPosition',[0.5 0.5 9.16025403784439],...'CameraPositionMode','manual',...'CameraTarget',[0.5 0.5 0.5],...'CameraTargetMode','manual',...'CameraUpVector',[0 1 0],...'CameraUpVectorMode','manual',...'CameraViewAngle',6.60861036031192,...'CameraViewAngleMode','manual',...'CLim',get(0,'defaultaxesCLim'),...'CLimMode','manual',...'Color',get(0,'defaultaxesColor'),...'ColorOrder',get(0,'defaultaxesColorOrder'),...'DataAspectRatio',get(0,'defaultaxesDataAspectRatio'),...'DataAspectRatioMode','manual',...'LooseInset',[24.7 5.61 18.05 3.825],...'PlotBoxAspectRatio',get(0,'defaultaxesPlotBoxAspectRatio'),...'PlotBoxAspectRatioMode','manual',...'TickDir',get(0,'defaultaxesTickDir'),...'TickDirMode','manual',...'XColor',get(0,'defaultaxesXColor'),...'XLim',get(0,'defaultaxesXLim'),...'XLimMode','manual',...'XTick',[0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1],...'XTickLabel',{ '0 '; '0.1'; '0.2'; '0.3'; '0.4'; '0.5'; '0.6'; '0.7'; '0.8'; '0.9'; '1 ' },...'XTickLabelMode','manual',...'XTickMode','manual',...'YColor',get(0,'defaultaxesYColor'),...'YLim',get(0,'defaultaxesYLim'),...'YLimMode','manual',...'YTick',[0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1],...'YTickLabel',{ '0 '; '0.1'; '0.2'; '0.3'; '0.4'; '0.5'; '0.6'; '0.7'; '0.8'; '0.9'; '1 ' },...'YTickLabelMode','manual',...'YTickMode','manual',...'ZColor',get(0,'defaultaxesZColor'),...'ZLim',get(0,'defaultaxesZLim'),...'ZLimMode','manual',...'ZTick',[0 0.5 1],...'ZTickLabel','',...'ZTickLabelMode','manual',...'ZTickMode','manual',...'Tag','pdfplot',...'UserData',[],...'Behavior',get(0,'defaultaxesBehavior'),...'CreateFcn', {@local_CreateFcn, '', appdata} );h5 = get(h4,'title');set(h5,...'Parent',h4,...'Units','data',...'FontUnits','points',...'BackgroundColor','none',...'Color',[0 0 0],...'EdgeColor','none',...'EraseMode','normal',...'DVIMode','auto',...'FontAngle','normal',...'FontName','Helvetica',...'FontSize',10,...'FontWeight','normal',...'HorizontalAlignment','center',...'LineStyle','-',...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -