📄 cs.m
字号:
function varargout = CS(varargin)% CS M-file for CS.fig% CS, by itself, creates a new CS or raises the existing% singleton*.%% H = CS returns the handle to a new CS or the handle to% the existing singleton*.%% CS('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in CS.M with the given input arguments.%% CS('Property','Value',...) creates a new CS or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before CS_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to CS_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 CS% Last Modified by GUIDE v2.5 05-Mar-2009 12:18:15% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @CS_OpeningFcn, ... 'gui_OutputFcn', @CS_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 CS is made visible.function CS_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 CS (see VARARGIN)% Choose default command line output for CShandles.output = hObject;movegui(gcf,'center'); % 设置窗口居中global canshu wcxy=varargin{1}; % 读取主界面传递的数据xlist=xy{1};ylist=xy{2};tx=xy{3};ty=xy{4};sq=xy{5};canshu=xy{6};errory=xy{7};wc=xy{8};yc=xy{9};list=1:sq;set(handles.listbox1,'String',[xlist;{num2str(tx)}]); % 显示测试样本中的输入数据set(handles.listbox2,'String',[ylist;{num2str(ty)}]); % 显示测试样本中的输出数据set(handles.listbox3,'String',[ylist;{num2str(yc')}]); % 显示神经网络预测值set(handles.listbox4,'String',[ylist;{num2str(errory)}]); % 显示神经网络预测值的误差set(handles.listbox5,'String',num2str(list')); % 显示训练次数set(handles.listbox5,'Value',sq);% Update handles structureguidata(hObject, handles);% UIWAIT makes CS wait for user response (see UIRESUME)% uiwait(handles.figure2);% --- Outputs from this function are returned to the command line.function varargout = CS_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 selection change in listbox1.function listbox1_Callback(hObject, eventdata, handles)% hObject handle to listbox1 (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 listbox1 contents as cell array% contents{get(hObject,'Value')} returns selected item from listbox1set([handles.listbox2,handles.listbox3,handles.listbox4],'Value',get(hObject,'Value')); % 定位其他列表的对应项% --- Executes during object creation, after setting all properties.function listbox1_CreateFcn(hObject, eventdata, handles)% hObject handle to listbox1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: listbox 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 listbox2.function listbox2_Callback(hObject, eventdata, handles)% hObject handle to listbox2 (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 listbox2 contents as cell array% contents{get(hObject,'Value')} returns selected item from listbox2set([handles.listbox1,handles.listbox3,handles.listbox4],'Value',get(hObject,'Value')); % 定位其他列表的对应项% --- Executes during object creation, after setting all properties.function listbox2_CreateFcn(hObject, eventdata, handles)% hObject handle to listbox2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: listbox 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 listbox3.function listbox3_Callback(hObject, eventdata, handles)% hObject handle to listbox3 (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 listbox3 contents as cell array% contents{get(hObject,'Value')} returns selected item from listbox3set([handles.listbox1,handles.listbox2,handles.listbox4],'Value',get(hObject,'Value')); % 定位其他列表的对应项% --- Executes during object creation, after setting all properties.function listbox3_CreateFcn(hObject, eventdata, handles)% hObject handle to listbox3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: listbox 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 listbox4.function listbox4_Callback(hObject, eventdata, handles)% hObject handle to listbox4 (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 listbox4 contents as cell array% contents{get(hObject,'Value')} returns selected item from listbox4set([handles.listbox1,handles.listbox2,handles.listbox3],'Value',get(hObject,'Value')); % 定位其他列表的对应项% --- Executes during object creation, after setting all properties.function listbox4_CreateFcn(hObject, eventdata, handles)% hObject handle to listbox4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: listbox 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 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)result1=get(handles.edit1,'String');result2=get(handles.edit2,'String');save result result1 result2; % 保存用户所选的训练结果% --- 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)close; % 关闭子界面% --- Executes on selection change in listbox5.function listbox5_Callback(hObject, eventdata, handles)% hObject handle to listbox5 (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 listbox5 contents as cell array% contents{get(hObject,'Value')} returns selected item from listbox5global canshu wci=get(handles.listbox5,'Value');set(handles.edit1,'String',canshu{i}); % 显示用户所选的训练参数set(handles.edit2,'String',[{num2str(wc(i,1))};{' '};{num2str(wc(i,2))}]); % 显示用户所选的训练结果% --- Executes during object creation, after setting all properties.function listbox5_CreateFcn(hObject, eventdata, handles)% hObject handle to listbox5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: listbox 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 edit1_Callback(hObject, eventdata, handles)% hObject handle to edit1 (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 edit1 as text% str2double(get(hObject,'String')) returns contents of edit1 as a double% --- Executes during object creation, after setting all properties.function edit1_CreateFcn(hObject, eventdata, handles)% hObject handle to edit1 (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 edit2_Callback(hObject, eventdata, handles)% hObject handle to edit2 (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 edit2 as text% str2double(get(hObject,'String')) returns contents of edit2 as a double% --- Executes during object creation, after setting all properties.function edit2_CreateFcn(hObject, eventdata, handles)% hObject handle to edit2 (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 during object creation, after setting all properties.function figure2_CreateFcn(hObject, eventdata, handles)% hObject handle to figure2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -