how to pass neural network train net as handles in matlab gui?
1 次查看(过去 30 天)
显示 更早的评论
function varargout = nngui1(varargin)
gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @nngui1_OpeningFcn, ... 'gui_OutputFcn', @nngui1_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end
if 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 nngui1 is made visible. function nngui1_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 nngui1 (see VARARGIN)
% Choose default command line output for nngui1 handles.output = hObject; net = network(1,2,[1;0],[1; 0],[0 0; 1 0],[0 1]); % Update handles structure guidata(hObject, handles);
% UIWAIT makes nngui1 wait for user response (see UIRESUME) % uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. function varargout = nngui1_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 structure varargout{1} = handles.output;
% --- Executes on button press in Bivariate. function Bivariate_Callback(hObject, eventdata, handles) [tr,targets,outputs,net1] = bivariate; [r,m,b] = regression(targets,outputs) net = net1; set(handles.rmse,'String',r) set(handles. AEedit4,net); guidata(handles.Bivariate, handles);
set(hObject,'BackgroundColor',[.9 .9 .9]); end
% --- Executes during object creation, after setting all properties. function waterpotntial_CreateFcn(hObject, eventdata, handles) % hObject handle to waterpotntial (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
function AEedit4_Callback(hObject, eventdata, handles) % hObject handle to AEedit4 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) temp = num2str(get(handles.slider1,'Value')) wp = num2str(get(handles.slider2,'Value')) net = (get(handles.AEedit4,'Value'))
ac= sim(net,[temp;wp])
set(handles.AEedit4,'String',num2str(ac));
% --- Executes during object creation, after setting all properties. function AEedit4_CreateFcn(hObject, eventdata, handles) % hObject handle to AEedit4 (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
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parallel and Cloud 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!