?? pre.m
字號(hào):
function varargout = pre(varargin)%PRE M-file for pre.fig% PRE, by itself, creates a new PRE or raises the existing% singleton*.%% H = PRE returns the handle to a new PRE or the handle to% the existing singleton*.%% PRE('Property','Value',...) creates a new PRE using the% given property value pairs. Unrecognized properties are passed via% varargin to pre_OpeningFcn. This calling syntax produces a% warning when there is an existing singleton*.%% PRE('CALLBACK') and PRE('CALLBACK',hObject,...) call the% local function named CALLBACK in PRE.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 pre% Last Modified by GUIDE v2.5 03-Jun-2008 16:50:56% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @pre_OpeningFcn, ... 'gui_OutputFcn', @pre_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 pre is made visible.function pre_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 prehandles.output = hObject;handles.handle='';% Update handles structureguidata(hObject, handles);% UIWAIT makes pre wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = pre_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 on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)% hObject handle to pushbutton1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% 初始化、賦值P = [0.1 0.7 0.8 0.8 1.0 ; 1.2 1.8 1.6 0.6 0.8 ];T = [1 1 1 0 0 ];plotpv(P,T);[ S, Q ] = size (T); net = newp(minmax(P),S); % 建立一個(gè)感知器網(wǎng)絡(luò) %net = train(net,P,T);% 繪制訓(xùn)練后的分類結(jié)果%plotc函數(shù)可以在已繪制的圖上加上感知器分類線handle=plotpc(net.iw{1},net.b{1});%利用樣本點(diǎn)訓(xùn)練網(wǎng)絡(luò)并繪出得到的分類線%adapt是神經(jīng)網(wǎng)絡(luò)自適應(yīng)函數(shù),sse是網(wǎng)絡(luò)平方和誤差函數(shù)E=1;while (sse(E)), [net,Y,E]=adapt(net,P,T); handle=plotpc(net.iw{1},net.b{1},handle);end; % --- Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -