📄 cs.asv
字号:
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 00:07:14% 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};net=xy{5};sq=xy{6};canshu=xy{7};m=numel(ty);se1=0;se2=0;for i=1:m/2 p_cs(:,i)=tx(i,:)'; cs(:,i)=sim(net,p_cs(:,i)); errory(i,1)=(ty(i,1)-cs(1,i))/ty(i,1); errory(i,2)=(ty(i,2)-cs(2,i))/ty(i,2); se1=se1+errory(i,1)^2; se2=se2+errory(i,2)^2;endwc(sq,1)=sqrt(se1/m);wc(sq,2)=sqrt(se2/m);list=1:sq;set(handles.listbox1,'String',[xlist;{num2str(tx)}]);set(handles.listbox2,'String',[ylist;{num2str(ty)}]);set(handles.listbox3,'String',[ylist;{num2str(cs')}]);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.txt b-ascii 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,:))};]);% --- 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -