📄 mfbox_rel_noneg.m
字号:
function varargout=mfbox_rel_noneg(varargin)% MFBOX_REL_NONEG M-file for mfbox_rel_noneg.fig%% See also: GUIDE, GUIDATA, GUIHANDLES%% Copyright by Peter Gruber and Fabian J. Theis% Signal Processing & Information Theory group% Institute of Biophysics, University of Regensburg, Germany% Homepage: http://research.fabian.theis.name% http://www-aglang.uni-regensburg.de%% This file is free software, subject to the % GNU GENERAL PUBLIC LICENSE, see gpl.txt% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name',mfilename, ... 'gui_Singleton',gui_Singleton, ... 'gui_OpeningFcn',@mfbox_rel_noneg_OpeningFcn, ... 'gui_OutputFcn',@mfbox_rel_noneg_OutputFcn, ... 'gui_LayoutFcn',[], ... 'gui_Callback',[]);if (nargin&&(ischar(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 mfbox_rel_noneg is made visible.function mfbox_rel_noneg_OpeningFcn(hObject,eventdata,handles,varargin)% varargin{1} contains the mfbss struct% varargin{2} (optional) contains the parameters% varargin{3} (optional) contains runflag (0: param edit only, 1: param+run, 2: run only)handles.output = hObject;handles.mfbss = varargin{1};tmethod = {'none','variance'};if (~isempty(handles.mfbss.design)), tmethod{end+1} = 'design'; endif (~isempty(handles.mfbss.reference)), tmethod{end+1} = 'reference'; endif (nargin>4), handles.params = varargin{2};else handles.params = [];endif (nargin>5), handles.runflag = varargin{3};else handles.runflag = 1;endt = find(strcmp(tmethod,handles.params.threshold_type));if (isempty(t)), t = 1; endset(handles.thresholdtype,'String',tmethod,'Value',t);set(handles.threshold,'String',sprintf('%1.4f',handles.params.threshold));switch handles.params.threshold_type case 'none' set(handles.threshold,'Enable','off'); otherwise set(handles.threshold,'Enable','on');endguidata(hObject,handles);uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout=mfbox_rel_noneg_OutputFcn(hObject,eventdata,handles) % varargout{1} contains the (modified) parametersif (isstruct(handles)) close(handles.figure1); varargout{1} = handles.params;else varargout{1} = [];end% --- Executes on button press in run.function run_Callback(hObject, eventdata, handles)handles.params.threshold = str2double(get(handles.threshold,'String'));t = get(handles.thresholdtype,'String');handles.params.threshold_type = t{get(handles.thresholdtype,'Value')};guidata(hObject,handles);uiresume(handles.figure1);% --- Executes on selection change in thresholdtype.function thresholdtype_Callback(hObject, eventdata, handles)t = get(handles.thresholdtype,'String');threshold_type = t{get(handles.thresholdtype,'Value')};switch threshold_type case 'none' set(handles.threshold,'Enable','off'); otherwise set(handles.threshold,'Enable','on');endguidata(hObject,handles);% --- Executes during object creation, after setting all properties.function thresholdtype_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction threshold_Callback(hObject, eventdata, handles)v = str2double(get(hObject,'String'));v = max(v,0);set(hObject,'String',sprintf('%1.4f',v));guidata(hObject,handles);% --- Executes during object creation, after setting all properties.function threshold_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -