?? multint.m
字號:
function varargout = MultInt(varargin)%MULTINT M-file for MultInt.fig% MULTINT, by itself, creates a new MULTINT or raises the existing% singleton*.%% H = MULTINT returns the handle to a new MULTINT or the handle to% the existing singleton*.%% MULTINT('Property','Value',...) creates a new MULTINT using the% given property value pairs. Unrecognized properties are passed via% varargin to MultInt_OpeningFcn. This calling syntax produces a% warning when there is an existing singleton*.%% MULTINT('CALLBACK') and MULTINT('CALLBACK',hObject,...) call the% local function named CALLBACK in MULTINT.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 MultInt% Last Modified by GUIDE v2.5 06-Nov-2005 16:34:55% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @MultInt_OpeningFcn, ... 'gui_OutputFcn', @MultInt_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 MultInt is made visible.function MultInt_OpeningFcn(hObject, eventdata, handles, varargin)set(handles.fcn,'string','tan(x^2+y^2)');set(handles.a,'string','0');set(handles.b,'string','pi/3');set(handles.c,'string','0');set(handles.d,'string','pi/6');set(handles.m,'string','4');set(handles.n,'string','4');set(handles.eps,'string','0.5*1e-5');!del fxy.mdiary fxy.mdisp(['function ','z=fxy(x,y)'])diary off% 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 MultInthandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes MultInt wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = MultInt_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 fcn_Callback(hObject, eventdata, handles)fcn=get(handles.fcn,'string');set(handles.fcn,'string',fcn);% hObject handle to fcn (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 fcn as text% str2double(get(hObject,'String')) returns contents of fcn as a double% --- Executes during object creation, after setting all properties.function fcn_CreateFcn(hObject, eventdata, handles)% hObject handle to fcn (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 INV_fcn_Callback(hObject, eventdata, handles)% hObject handle to INV_fcn (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 INV_fcn as text% str2double(get(hObject,'String')) returns contents of INV_fcn as a double% --- Executes during object creation, after setting all properties.function INV_fcn_CreateFcn(hObject, eventdata, handles)% hObject handle to INV_fcn (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 Cal.function Cal_Callback(hObject, eventdata, handles)format longfcn=get(handles.fcn,'string');a=str2num(get(handles.a,'string'));b=str2num(get(handles.b,'string'));c=str2num(get(handles.c,'string'));d=str2num(get(handles.d,'string'));m=str2num(get(handles.m,'string'));n=str2num(get(handles.n,'string'));eps=str2num(get(handles.eps,'string'));diary fxy.mdisp(['z=',fcn,';']);diary offtic;[I i]=MultipleIntegral(fcn,a,b,c,d,m,n,eps);!del fxy.mdiary fxy.mdisp(['function ','z=fxy(x,y)'])diary offt=toc;handles.I=I;set(handles.INV_fcn,'string',num2str(I,10));set(handles.CT,'string',num2str(t));set(handles.XD,'string',num2str(m*2^i));set(handles.YD,'string',num2str(n*2^i));guidata(hObject,handles);% hObject handle to Cal (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% --- Executes during object creation, after setting all properties.function m_CreateFcn(hObject, eventdata, handles)% hObject handle to m (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 a_CreateFcn(hObject, eventdata, handles)% hObject handle to a (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 c_Callback(hObject, eventdata, handles) c= get(gcbo,'String'); set(handles.c,'string',c); % hObject handle to c (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 c as text% str2double(get(hObject,'String')) returns contents of c as a double% --- Executes during object creation, after setting all properties.function c_CreateFcn(hObject, eventdata, handles)% hObject handle to c (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 b_CreateFcn(hObject, eventdata, handles)% hObject handle to b (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 d_CreateFcn(hObject, eventdata, handles)% hObject handle to d (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.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -