?? demo.m
字號:
function varargout = demo(varargin)% DEMO M-file for demo.fig% DEMO, by itself, creates a new DEMO or raises the existing% singleton*.%% H = DEMO returns the handle to a new DEMO or the handle to% the existing singleton*.%% DEMO('Property','Value',...) creates a new DEMO using the% given property value pairs. Unrecognized properties are passed via% varargin to demo_OpeningFcn. This calling syntax produces a% warning when there is an existing singleton*.%% DEMO('CALLBACK') and DEMO('CALLBACK',hObject,...) call the% local function named CALLBACK in DEMO.M with the given input% arguments.%% *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 demo% Last Modified by GUIDE v2.5 13-Jun-2004 23:14:23% Author: Vikas Sindhwani (vikass@cs.uchicago.edu)% Depatment of Computer Science, University of Chicago% http://www.cs.uchicago.edu/~vikass% June 2004 % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @demo_OpeningFcn, ... 'gui_OutputFcn', @demo_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 demo is made visible.function demo_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 unrecognized PropertyName/PropertyValue pairs from the% command line (see VARARGIN)% Choose default command line output for demohandles.output = hObject;% Update handles structure% UIWAIT makes demo wait for user response (see UIRESUME)% uiwait(handles.figure1);handles.data = load('2moons.mat');handles.mode=2; % fully supervisedhandles.kernel='rbf';handles.kernelparam=0.35;handles.algo='rlsc';handles.lab=2;handles.generate=1;handles.Y=handles.data.y;set(handles.radiobutton2,'Value',1);set(handles.lambda1,'Value', 0.4511); handles.gamma_A=0.014362;set(handles.gamma_A_value,'String',num2str(handles.gamma_A));set(handles.lambda2,'Value',0.7852); handles.gamma_I=0.7852;set(handles.gamma_I_value,'String',num2str(handles.gamma_I));guidata(hObject, handles);% --- Outputs from this function are returned to the command line.function varargout = demo_OutputFcn(hObject, eventdata, handles)% varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Get default command line output from handles structurevarargout{1} = handles.output;% --- Executes during object creation, after setting all properties.function lambda1_CreateFcn(hObject, eventdata, handles)% hObject handle to lambda1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: slider controls usually have a light gray background, change% 'usewhitebg' to 0 to use default. See ISPC and COMPUTER.usewhitebg = 0;if usewhitebg set(hObject,'BackgroundColor',[.9 .9 .9]);else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on slider movement.function lambda1_Callback(hObject, eventdata, handles)% hObject handle to lambda1 (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,'Value') returns position of slider% get(hObject,'Min') and get(hObject,'Max') to determine range of sliderp=get(hObject,'Value');handles.gamma_A=10^(7*p-5)-10^(-5);set(handles.gamma_A_value,'String',num2str(handles.gamma_A));guidata(hObject,handles);% --- Executes during object creation, after setting all properties.function lambda2_CreateFcn(hObject, eventdata, handles)% hObject handle to lambda2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: slider controls usually have a light gray background, change% 'usewhitebg' to 0 to use default. See ISPC and COMPUTER.usewhitebg = 1;if usewhitebg set(hObject,'BackgroundColor',[.9 .9 .9]);else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on slider movement.function lambda2_Callback(hObject, eventdata, handles)% hObject handle to lambda2 (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,'Value') returns position of slider% get(hObject,'Min') and get(hObject,'Max') to determine range of sliderp=get(hObject,'Value');handles.gamma_I=10^(7*p-5)-10^(-5);set(handles.gamma_I_value,'String',num2str(handles.gamma_I));guidata(hObject,handles);% --- Executes during object creation, after setting all properties.function select_algo_CreateFcn(hObject, eventdata, handles)% hObject handle to select_algo (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 select_algo.function select_algo_Callback(hObject, eventdata, handles)% hObject handle to select_algo (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 select_algo contents as cell array% contents{get(hObject,'Value')} returns selected item from select_algocontents = get(hObject,'String');handles.algo=contents{get(hObject,'Value')};guidata(hObject,handles);% --- Executes during object creation, after setting all properties.function enter_kernelparams_CreateFcn(hObject, eventdata, handles)% hObject handle to enter_kernelparams (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 enter_kernelparams_Callback(hObject, eventdata, handles)% hObject handle to enter_kernelparams (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 enter_kernelparams as text% str2double(get(hObject,'String')) returns contents of enter_kernelparams as a doublehandles.kernelparam=str2double(get(hObject,'String'));guidata(hObject,handles);% --- Executes on button press in run.function run_Callback(hObject, eventdata, handles)% hObject handle to run (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% handlesX=handles.data.x;Y=handles.data.y;handles.modeoptions.NN=6;options.gamma_A=handles.gamma_A;options.gamma_I=handles.gamma_I;options.Kernel=handles.kernel;options.KernelParam=handles.kernelparam;options.GraphDistanceFunction='euclidean';options.GraphWeights='binary';options.GraphNormalize=1;options.GraphWeightParam=1;method=handles.algo;switch handles.mode
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -