📄 a2.m
字号:
function varargout = A2(varargin)%A2 M-file for A2.fig% A2, by itself, creates a new A2 or raises the existing% singleton*.%% H = A2 returns the handle to a new A2 or the handle to% the existing singleton*.%% A2('Property','Value',...) creates a new A2 using the% given property value pairs. Unrecognized properties are passed via% varargin to A2_OpeningFcn. This calling syntax produces a% warning when there is an existing singleton*.%% A2('CALLBACK') and A2('CALLBACK',hObject,...) call the% local function named CALLBACK in A2.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 A2% Last Modified by GUIDE v2.5 07-Oct-2008 14:55:54% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @A2_OpeningFcn, ... 'gui_OutputFcn', @A2_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 A2 is made visible.function A2_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 A2handles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes A2 wait for user response (see UIRESUME)% uiwait(handles.PAINT);% --- Outputs from this function are returned to the command line.function varargout = A2_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;function Vi_Callback(hObject, eventdata, handles)% hObject handle to Vi (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 Vi as text% str2double(get(hObject,'String')) returns contents of Vi as a doubleV=[1.00,2.00,2.01,2.02,2.03,2.04,2.05,2.06,2.07,2.08,2.09,2.10];I=[0.00,0.049,0.073,0.110,0.169,0.265,0.422,0.684,1.126,1.875,3.157,5.360];p=polyfit(V,I,60);V=str2num(get(handles.Vi,'String'));Y=polyval(p,V);set(handles.Ii,'String',Y);% --- Executes during object creation, after setting all properties.function Vi_CreateFcn(hObject, eventdata, handles)% hObject handle to Vi (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 Ii_Callback(hObject, eventdata, handles)% hObject handle to Ii (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 Ii as text% str2double(get(hObject,'String')) returns contents of Ii as a double% --- Executes during object creation, after setting all properties.function Ii_CreateFcn(hObject, eventdata, handles)% hObject handle to Ii (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 on button press in PAINT.function PAINT_Callback(hObject, eventdata, handles)% hObject handle to PAINT (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)V=[1.00,2.00,2.01,2.02,2.03,2.04,2.05,2.06,2.07,2.08,2.09,2.10];I=[0.00,0.049,0.073,0.110,0.169,0.265,0.422,0.684,1.126,1.875,3.157,5.360];p=polyfit(V,I,60);V=1:0.01:100;Y=polyval(p,V);plot(V,Y);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -