| ²é¿´: 2115 | »Ø¸´: 13 | ||
ÍûÔÂÈÎгæ (СÓÐÃûÆø)
|
[ÇóÖú]
matlab guiÇóÖú ÒÑÓÐ2È˲ÎÓë
|
|
ÈçºÎ´´½¨Ò»¸ö°´Å¥µ÷ÓÃMÎļþ£¬²¢½«ÏÔʾÔÚÏÔʾÔÚÒ»¸öÎı¾¿òÖУ¬Èçͼµã»÷ÄǸöä¯ÀÀ°´Å¥Ëùʾ¡£Ð»Ð»´ó¼Ò 2YKN`C86P@ZR]7}V5BXS]WO.png YAO(R~RDP([420[T0B8$0]A.png ]O[26OH(QL7YKRV[4K~R5%C.png |
» ²ÂÄãϲ»¶
0703»¯Ñ§µ÷¼Á£¬Çó¸÷λÀÏʦÊÕÁô
ÒѾÓÐ8È˻ظ´
070303Ò»Ö¾Ô¸Î÷±±´óѧѧ˶310ÕÒµ÷¼Á
ÒѾÓÐ8È˻ظ´
085600²ÄÁÏÓ뻯¹¤ Çóµ÷¼Á
ÒѾÓÐ14È˻ظ´
±¾ÈË¿¼085602 »¯Ñ§¹¤³Ì ר˶
ÒѾÓÐ13È˻ظ´
²ÄÁÏÓ뻯¹¤Çóµ÷¼Á
ÒѾÓÐ3È˻ظ´
283Çóµ÷¼Á
ÒѾÓÐ13È˻ظ´
312Çóµ÷¼Á
ÒѾÓÐ4È˻ظ´
285Çóµ÷¼Á
ÒѾÓÐ6È˻ظ´
²ÄÁÏÓ뻯¹¤×¨Ë¶µ÷¼Á
ÒѾÓÐ3È˻ظ´
0703»¯Ñ§µ÷¼Á £¬Áù¼¶Òѹý£¬ÓпÆÑоÀú
ÒѾÓÐ6È˻ظ´
» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:
ÇóÖúMatlabµÄGUIÎÊÌâ
ÒѾÓÐ1È˻ظ´
MATLAB gui ÏÂÀ²Ëµ¥µÄʵÏÖ
ÒѾÓÐ1È˻ظ´
matlab ÔÆÍ¼ÇóÖú
ÒѾÓÐ0È˻ظ´
MATLABÉñ¾ÍøÂçGUI
ÒѾÓÐ0È˻ظ´
ÇóÖú£¡£¡£¡MATLABµÄGUI·ÉÐй켣·¢ÉúÆ÷£¬ÄÄλ´óÉñÓа¡£¿£¿£¿°ï¸ö棡£¡£¡
ÒѾÓÐ0È˻ظ´
MATLABÉúÃüµÄÓÎÏ·´úÂëÇóÖú
ÒѾÓÐ0È˻ظ´
ÓÅ»¯¹¤¾ßÏäGUI±à³ÌÇóÖú
ÒѾÓÐ3È˻ظ´
MATLAB ʵʱÊÓÆµÍ¼Ïñʶ±ðϵͳ¡ª¡ªÇóÖú£¡£¡£¡
ÒѾÓÐ10È˻ظ´
matlab GUI ת»» ¿ÉÖ´ÐÐÎļþ
ÒѾÓÐ1È˻ظ´
MATLAB GUI ÇóÖú
ÒѾÓÐ3È˻ظ´
ÇóÖúmatlab/guiÖлËĸö×Óͼ£¬³öÀ´µÄλÖò»¶Ô£¬Çó´ó³æ½â¾ö
ÒѾÓÐ8È˻ظ´
Matlab»æÍ¼ÔÙÇóÖú
ÒѾÓÐ11È˻ظ´
ÇóÖúmatlabµÄ°²×°ÎÊÌâ
ÒѾÓÐ3È˻ظ´
Matlab°²×°Ð¡²å¼þ£¬Óöµ½getconfµÄÎÊÌ⣬ÇóÖú£¡£¡
ÒѾÓÐ1È˻ظ´
¡¾ÇóÖú¡¿<<MATLAB GUIÉè¼ÆÑ§Ï°ÊÖ¼Ç>>
ÒѾÓÐ2È˻ظ´
¡¾ÇóÖú¡¿ÈçºÎ·Ö±ðÕç±ðºÍÌáÈ¡Matlab ÒÅ´«¹¤¾ßGUIµÄÔËÐнá¹û£¿
ÒѾÓÐ0È˻ظ´
ÇóÖú£ºMATLABÀïÒ»¸ötoolboxµÄGUIÕÒ²»µ½
ÒѾÓÐ1È˻ظ´
¡¾ÇóÖú¡¿Matlab GUIÈëÃŵÄÎÊÌâ
ÒѾÓÐ6È˻ظ´
¡¾ÇóÖú¡¿matlabµÄGUIÉè¼Æppt»òÕßÊÓÆµ½Ì³Ì
ÒѾÓÐ0È˻ظ´
achilFes1990
ľ³æ (ÖøÃûдÊÖ)
- Ó¦Öú: 363 (˶ʿ)
- ½ð±Ò: 5307.5
- ºì»¨: 21
- Ìû×Ó: 1400
- ÔÚÏß: 197.1Сʱ
- ³æºÅ: 1115537
- ×¢²á: 2010-10-07
- ÐÔ±ð: GG
- רҵ: º£Ñ󹤳Ì

2Â¥2015-11-29 14:24:46
ÍûÔÂÈÎ
гæ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 492.6
- É¢½ð: 30
- Ìû×Ó: 141
- ÔÚÏß: 66.9Сʱ
- ³æºÅ: 3888752
- ×¢²á: 2015-05-25
- ÐÔ±ð: GG
- רҵ: »úе¹¤³Ì
3Â¥2015-11-29 14:26:28
onelightwang
½ð³æ (СÓÐÃûÆø)
- Ó¦Öú: 10 (Ó×¶ùÔ°)
- ½ð±Ò: 1706.9
- ºì»¨: 1
- Ìû×Ó: 94
- ÔÚÏß: 45.7Сʱ
- ³æºÅ: 3870466
- ×¢²á: 2015-05-14
- ÐÔ±ð: GG
- רҵ: ¹âѧÐÅÏ¢»ñÈ¡Óë´¦Àí
4Â¥2015-11-29 16:14:41
ÍûÔÂÈÎ
гæ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 492.6
- É¢½ð: 30
- Ìû×Ó: 141
- ÔÚÏß: 66.9Сʱ
- ³æºÅ: 3888752
- ×¢²á: 2015-05-25
- ÐÔ±ð: GG
- רҵ: »úе¹¤³Ì
5Â¥2015-11-29 18:36:53
µÛ_×ð
ľ³æ (ÕýʽдÊÖ)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 2216
- ºì»¨: 13
- Ìû×Ó: 564
- ÔÚÏß: 77.1Сʱ
- ³æºÅ: 4202193
- ×¢²á: 2015-11-06
- ÐÔ±ð: GG
- רҵ: ÎïÀíѧI
6Â¥2015-11-29 18:37:59
onelightwang
½ð³æ (СÓÐÃûÆø)
- Ó¦Öú: 10 (Ó×¶ùÔ°)
- ½ð±Ò: 1706.9
- ºì»¨: 1
- Ìû×Ó: 94
- ÔÚÏß: 45.7Сʱ
- ³æºÅ: 3870466
- ×¢²á: 2015-05-14
- ÐÔ±ð: GG
- רҵ: ¹âѧÐÅÏ¢»ñÈ¡Óë´¦Àí
7Â¥2015-11-30 19:20:48
ÍûÔÂÈÎ
гæ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 492.6
- É¢½ð: 30
- Ìû×Ó: 141
- ÔÚÏß: 66.9Сʱ
- ³æºÅ: 3888752
- ×¢²á: 2015-05-25
- ÐÔ±ð: GG
- רҵ: »úе¹¤³Ì
|
function varargout = DemoGUI(varargin) % DEMOGUI M-file for DemoGUI.fig % DEMOGUI, by itself, creates a new DEMOGUI or raises the existing % singleton*. % % H = DEMOGUI returns the handle to a new DEMOGUI or the handle to % the existing singleton*. % % DEMOGUI('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in DEMOGUI.M with the given input arguments. % % DEMOGUI('Property','Value',...) creates a new DEMOGUI or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before DemoGUI_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to DemoGUI_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 DemoGUI % Last Modified by GUIDE v2.5 16-Apr-2005 18:42:13 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @DemoGUI_OpeningFcn, ... 'gui_OutputFcn', @DemoGUI_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && isstr(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 DemoGUI is made visible. function DemoGUI_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 DemoGUI (see VARARGIN) % Choose default command line output for DemoGUI handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes DemoGUI wait for user response (see UIRESUME) % uiwait(handles.DemoFig); % ÈÕÆÚʱ¼äÏÔʾ set(handles.timestr,'string',datestr(now,0)); htimer = timer('StartDelay',1,'TimerFcn',... 'htimestr=findall(0,''tag'',''timestr'');set(htimestr,''string'',datestr(now,0));',... 'Period',1,'ExecutionMode','fixedSpacing','tag','showtime'); start(htimer); set(hObject,'doublebuffer','on'); % --- Outputs from this function are returned to the command line. function varargout = DemoGUI_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 ExitBtn. function ExitBtn_Callback(hObject, eventdata, handles) % hObject handle to ExitBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) selection = questdlg(['Í˳ö ' get(handles.DemoFig,'Name') '?'],... ['Í˳ö ' get(handles.DemoFig,'Name') '...'],... 'ÊÇ','·ñ','ÊÇ'); if strcmp(selection,'·ñ') return; end htimer = timerfind('tag','showtime'); stop(htimer); delete(htimer); delete(handles.DemoFig); % --- Executes on button press in HelpBtn. function HelpBtn_Callback(hObject, eventdata, handles) % hObject handle to HelpBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % str={'¶Ô²»Æð£¬Ä¿Ç°ÉÐδÍê³É˵Ã÷Îļþ';' ´òË㾡¿ìÍêÉÆÕû¸öϵͳ¹¦Äܼ°ÆäʹÓÃ˵Ã÷'}; % msgbox(str,'ʹÓðïÖú','help','non-modal'); !CNCHelp.CHM % ¾«²å²¹°´Å¥»Øµ÷º¯Êý % --- Executes on button press in JinBtn. function JinBtn_Callback(hObject, eventdata, handles) % hObject handle to JinBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % »ñÈ¡ÉèÖõIJÎÊýÖµ theta0 = get(handles.startRad,'UserData'); % ÍâÂÖÀªÆðʼµã¼«½Ç thetat = get(handles.endRad,'UserData'); % ÍâÂÖÀªÖÐÖ¹µã¼«½Ç interpTime = get(handles.interpT,'UserData'); % ²å²¹ÖÜÆÚ ms mihuaNum = get(handles.miHuaNum,'UserData'); % ÃÜ»¯µãÊý jinjiV = get(handles.jinjiV,'UserData'); % ½ø¸øËÙ¶È mm/min jinjiV = jinjiV/60; % ½ø¸øËÙ¶Èmm/sec clrjinline = get(handles.clrJin,'BackgroundColor'); % ¾«²åÖµµãÏßÑÕÉ« % »ñÈ¡ÍâÂÖÀªº¯ÊýÃû filename = get(handles.SelectFcnBtn,'UserData'); if isempty(filename) msgbox('ûÓÐѡȡÂÖÀªº¯Êý£¡','²Ù×÷´íÎó'); return; end [pathstr,fcnname] = fileparts(filename); %»ñµÃÎļþÃûÓë·¾¶Ãû % ÅжÏÊÇ˳Բ»¹ÊÇÄæÔ²²å²¹,ʵÏÖ²»¹Ü˳Բ»¹ÊÇÄæÔ²¶¼¿ÉÓ㨲»¹ýÖ»²âÊÔÁË˳Բ££ÄæÊ±Õë²å²¹£© if theta0>thetat % ÄæÔ² flag = -1; else % ˳Բ flag = 1; end set(gcf,'doublebuffer','on'); axis(handles.axes2); % ÉèÖÃaxes2Ϊµ±Ç°×ø±êÖá hjinline = line('color',clrjinline,'marker','.','markersize',4,... 'visible','off', 'tag','jinline'); % ´´½¨´Ö²åÖµÏß¶ÔÏó culinedata = getappdata(handles.CuBtn,'culinedata'); % »ñÈ¡´Ö²å²¹ÏßÊý¾Ý cutheta = culinedata(:,1); % ¼«½Ç curho = culinedata(:,2); % ¼«¾¶ numCu = length(culinedata); % ´Ö²å²¹µãÊý theta = []; r = []; set(hjinline,'visible','on'); outflag = 0; % hbar = waitbar(0,'Please wait...','name','¾«²å²¹½øÐÐÖÐ'); for k = 1:numCu-1 % ¶Ôÿ¶Î´Ö²å²¹Çé¿ö tmptheta = cutheta(k); % theta0 rr0 = curho(k); % rho0 theta = [theta tmptheta]; r = [r rr0]; [xd,yd] = pol2cart(theta,r); % ¼«×ø±ê±ä³ÉÆ½ÃæÖ±½Ç×ø±ê set(hjinline,'xdata',xd,'ydata',yd); for n = 2:mihuaNum % ¼ÆËãÿ¶Î´Ö²å²¹ÖÐÃÜ»¯µã×ø±ê drda = drdtheta(fcnname,tmptheta); % ¼ÆËã¸ÃµãµÄÊýֵ΢·Ö deletatheta = interpTime/1000*jinjiV/(drda^2+rr0^2)^(0.5); % ¼ÆËãdeltatheta tmptheta = flag*deletatheta+tmptheta; % µü´úÇóÈ¡ÏÂÒ»¸ö¼«½Ç if flag*tmptheta>flag*cutheta(end) % ¶ÔÓÚ×îºóÒ»¶ÎµÄÌØÊâ´¦Àí,ÒòΪ×îºóÒ»¶Î¿ÉÄܱÈÒÔǰµÄ¶Ì tmptheta = cutheta(end); % ÊDz»Äܹ»²åÈënum¸öÃÜ»¯µãµÄ outflag = 1; end rr0 = feval(fcnname,tmptheta); theta = [theta tmptheta]; r = [r rr0]; [xd,yd] = pol2cart(theta,r); set(hjinline,'xdata',xd,'ydata',yd); if outflag==1 break; % ×îºóÒ»¶ÎÌØÊâ´¦ÀíÊ±Ìø³öÑ»· end end % waitbar(k/(numCu-1),hbar); end % close(hbar); theta = [theta cutheta(end)]; r = [r curho(end)]; jinlinedata = [theta( r( ];setappdata(hObject,'jinlinedata',jinlinedata); % ±£´æ¾«²å²¹ÏßÊý¾Ýµ½¾ä±úÖÐ set(handles.chkJin,'enable','on'); % ʹµÃÏÔʾÒþ²ØÏ߸´Ñ¡¿ò¿ÉÓà chkLegend_Callback(handles.chkLegend,[], handles); % ´Ö²å²¹°´Å¥»Øµ÷º¯Êý % --- Executes on button press in CuBtn. function CuBtn_Callback(hObject, eventdata, handles) % hObject handle to CuBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % »ñÈ¡ÉèÖõIJÎÊýÖµ theta0 = get(handles.startRad,'UserData'); % ÍâÂÖÀªÆðʼµã¼«½Ç thetat = get(handles.endRad,'UserData'); % ÍâÂÖÀªÖÐÖ¹µã¼«½Ç interpTime = get(handles.interpT,'UserData'); % ²å²¹ÖÜÆÚ ms jinjiV = get(handles.jinjiV,'UserData'); % ½ø¸øËÙ¶È mm/min jinjiV = jinjiV/60; % ½ø¸øËÙ¶Èmm/sec clrlunline = get(handles.clrLun,'BackgroundColor'); % ÂÖÀªÏßÑÕÉ« clrculine = get(handles.clrCu,'BackgroundColor'); % ´Ö²åÖµµãÏßÑÕÉ« % »ñÈ¡ÍâÂÖÀªº¯ÊýÃû filename = get(handles.SelectFcnBtn,'UserData'); if isempty(filename) msgbox('ûÓÐѡȡÂÖÀªº¯Êý£¡','²Ù×÷´íÎó'); return; end [pathstr,fcnname] = fileparts(filename); addpath(pathstr,'-begin'); % ½«ÍâÂÖÀªº¯ÊýËùÔÚ·¾¶¼ÓÈëmatlab·¾¶ÖÐ set(handles.chklun,'enable','on'); % ʹ¸´Ñ¡¿ò¿ÉÓà set(handles.chkLegend,'enable','on'); % ʹ¸´Ñ¡¿ò¿ÉÓà set(handles.chkCu,'enable','on'); % ʹ¸´Ñ¡¿ò¿ÉÓà % »æÖÆÍâÂÖÀªÏß theta = linspace(theta0,thetat,1000); r = feval(fcnname,theta); % ¼ÆËãÍâÂÖÀª if length(r)~=length(theta) % ͨ³£ÊÇÓÉÓÚÍâÂÖÀªº¯Êý²»¶ÔÔì³É msgbox('ÍâÂÖÀªº¯Êý´íÎó','³ö´íÁË...'); return; end axis(handles.axes2); hlunline = polar(theta,r); set(hlunline,'color',clrlunline,'tag','lunline'); % ÉèÖÃtagÒÔºóºÃÓà lundata = [theta( r( ];setappdata(hObject,'lundata',lundata); % ±£´æÂÖÀªÏßÊý¾Ýµ½¾ä±úÖÐ hold on; hculine = line('color',clrculine,'marker','.','markersize',10,... 'tag','culine'); % ´Ö²åÖµÏß¶ÔÏó 'erasemode','xor', hold off; theta = []; r = []; % ÅжÏÊÇ˳Բ»¹ÊÇÄæÔ²²å²¹,ʵÏÖ²»¹Ü˳Բ»¹ÊÇÄæÔ²¶¼¿ÉÓ㨲»¹ýÖ»²âÊÔÁË˳Բ££ÄæÊ±Õë²å²¹£© if theta0>thetat % ÄæÔ² flag = -1; else % ˳Բ flag = 1; end tmptheta = theta0; while flag*tmptheta<flag*thetat % ÖÕÖ¹Åжϣ¬¿¼ÂÇÁË˳ԲÓëÄæÔ² rr0 = feval(fcnname,tmptheta); % ¼ÆËãÍâÂÖÀª¸Ã¼«½Ç³öµÄ¼«¾¶ theta = [theta tmptheta]; r = [r rr0]; [xd,yd] = pol2cart(theta,r); % ת»»ÎªÖ±½Ç×ø±êϵÊýÖµ set(hculine,'xdata',xd,'ydata',yd); % ¸üвåÖµµã drda = drdtheta(fcnname,tmptheta); % ¼ÆËã¸Ã¼«½Ç´¦Êýֵ΢·Ö deletatheta = interpTime/1000*jinjiV/(drda^2+rr0^2)^(0.5); tmptheta = flag*deletatheta+tmptheta; % µü´úÇóÈ¡ÏÂÒ»¸öµã¼«½Ç end rr0 = feval(fcnname,thetat); % ÖÕµã¼ÓÈë theta = [theta thetat]; r = [r rr0]; culinedata = [theta( r( ];setappdata(hObject,'culinedata',culinedata); % ±£´æ´Ö²å²¹ÏßÊý¾Ýµ½¾ä±úÖÐ set(handles.ExportDataBtn,'enable','on'); set(handles.JinBtn,'enable','on'); chkLegend_Callback(handles.chkLegend,[], handles); % µ÷ÓÃͼÀý¸´Ñ¡¿òµÄ»Øµôº¯Êý % --- Executes during object creation, after setting all properties. function FcnName_CreateFcn(hObject, eventdata, handles) % hObject handle to FcnName (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on button press in SelectFcnBtn. function SelectFcnBtn_Callback(hObject, eventdata, handles) % hObject handle to SelectFcnBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) [filename, pathname] = uigetfile('*.m', 'ѡȡÍâÂÖÀªÏßMÎļþ'); if filename~=0 set(handles.FcnName,'string',filename); set(hObject,'UserData',[pathname filename]); set(handles.JinBtn,'enable','off'); set(handles.ExportDataBtn,'enable','off'); set(handles.chklun,'enable','off'); set(handles.chkCu,'enable','off'); set(handles.chkJin,'enable','off'); set(handles.chkLegend,'value',0,'enable','off'); axis(handles.axes2); cla chkLegend_Callback(handles.chkLegend,[], handles); % ¸üÐÂͼÁÐ else set(handles.FcnName,'string','ÉÐδѡȡ'); end % --- Executes on button press in ExportDataBtn. function ExportDataBtn_Callback(hObject, eventdata, handles) % hObject handle to ExportDataBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % str={'¶Ô²»Æð£¬Ä¿Ç°ÉÐδÍê³É˵Ã÷Îļþ';' ´òË㾡¿ìÍêÉÆÕû¸öϵͳ¹¦Äܼ°ÆäʹÓÃ˵Ã÷'}; % msgbox(str,'ʹÓðïÖú','help','non-modal'); type = get(handles.dataType,'UserData'); % »ñÈ¡ÉèÖõĵ¼³öÊý¾Ý¸ñʽ 1-mat,2-txt,3-dat % % »ñÈ¡¸÷ÖÖͼÏߵľä±ú % hjinline = findobj(0,'tag','jinline'); % hculine = findobj(0,'tag','culine'); % hlunline = findobj(0,'tag','lunline'); % ±£´æÊ± % % handles.CuBtn % setappdata(hObject,'culinedata',culinedata); % ±£´æ´Ö²å²¹ÏßÊý¾Ýµ½¾ä±úÖÐ % setappdata(hObject,'lundata',lundata); % ±£´æÂÖÀªÏßÊý¾Ýµ½¾ä±úÖÐ % % handles.JinBtn % setappdata(hObject,'jinlinedata',jinlinedata); % ±£´æ¾«²å²¹ÏßÊý¾Ýµ½¾ä±úÖÐ lundata = getappdata(handles.CuBtn,'lundata'); culinedata = getappdata(handles.CuBtn,'culinedata'); jinlinedata = getappdata(handles.JinBtn,'jinlinedata'); switch type case 1, [filename, pathname] = uiputfile('*.mat', '±£´æ²å²¹½á¹û'); if filename==0 % È¡Ïû return; end save([pathname filename],'lundata','culinedata','jinlinedata'); case 2, [filename, pathname] = uiputfile('*.txt', '±£´æ²å²¹½á¹û'); if filename==0 return; end [pathstr,filename]=fileparts(filename); fid = fopen([pathname filename,'.txt'],'w'); fprintf(fid,'\n£¥=================%s=================\r\n',datestr(now,0)); fprintf(fid,'£¥ÔʼÍâÂÖÀªÏßÊý¾Ý\r\n'); fprintf(fid,'£¥ ¼«½Ç \t ¼«¾¶\r\n'); fprintf(fid,'%8.6f \t %8.6f\r\n',lundata'); fprintf(fid,'£¥´Ö²å²¹µãÊý¾Ý\r\n'); fprintf(fid,'£¥ ¼«½Ç \t ¼«¾¶\r\n'); fprintf(fid,'%8.6f \t %8.6f\r\n',culinedata'); fprintf(fid,'£¥¾«²å²¹µãÊý¾Ý\r\n'); fprintf(fid,'£¥ ¼«½Ç \t ¼«¾¶\r\n'); fprintf(fid,'%8.6f \t %8.6f\r\n',jinlinedata'); fclose(fid); case 3, [filename, pathname] = uiputfile('*.dat', '±£´æ²å²¹½á¹û'); if filename==0 return; end [pathstr,filename]=fileparts(filename); save([pathname filename,'.dat'],'lundata','culinedata','jinlinedata','-ascii','-double'); otherwise, msgbox('ÕÕµÀÀíÊDz»»á³öÏÖµÄ~'); end % --- Executes on button press in ResetBtn. function ResetBtn_Callback(hObject, eventdata, handles) % hObject handle to ResetBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % ÉèÖø÷ÖÖ²ÎÊýΪĬÈÏÖµ set(handles.startRad,'string','0','UserData',0); set(handles.endRad,'string','2*pi','UserData',2*pi); set(handles.miHuaNum,'string','4','UserData',4); set(handles.interpT,'string','8','UserData',8); set(handles.jinjiV,'string','4000','UserData',4000); set(handles.clrLun,'BackgroundColor',[0 0 0]); set(handles.clrCu,'BackgroundColor',[0 0 1]); set(handles.clrJin,'BackgroundColor',[1 1 0.5]); set(handles.dataType,'value',1,'UserData',1); set(handles.chkLegend,'value',0,'UserData',0); % --- Executes during object creation, after setting all properties. function startRad_CreateFcn(hObject, eventdata, handles) % hObject handle to startRad (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function startRad_Callback(hObject, eventdata, handles) % hObject handle to startRad (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 startRad as text % str2double(get(hObject,'String')) returns contents of startRad as a double str = get(hObject,'string'); data = str2num(str); if isempty(data) % ÊäÈë²ÎÊýÓÐЧÐÔ¼ì²â errordlg('ÊäÈë±ØÐëΪÊýÖµ£¡','²ÎÊý´íÎó'); set(hObject,'BackgroundColor','r'); else set(hObject,'BackgroundColor','w'); set(hObject,'UserData',data); end % --- Executes during object creation, after setting all properties. function endRad_CreateFcn(hObject, eventdata, handles) % hObject handle to endRad (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function endRad_Callback(hObject, eventdata, handles) % hObject handle to endRad (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 endRad as text % str2double(get(hObject,'String')) returns contents of endRad as a double str = get(hObject,'string'); data = str2num(str); if isempty(data) % ÊäÈë²ÎÊýÓÐЧÐÔ¼ì²â errordlg('ÊäÈë±ØÐëΪÊýÖµ£¡','²ÎÊý´íÎó'); set(hObject,'BackgroundColor','r'); else set(hObject,'BackgroundColor','w'); set(hObject,'UserData',data); end % --- Executes during object creation, after setting all properties. function miHuaNum_CreateFcn(hObject, eventdata, handles) % hObject handle to miHuaNum (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function miHuaNum_Callback(hObject, eventdata, handles) % hObject handle to miHuaNum (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 miHuaNum as text % str2double(get(hObject,'String')) returns contents of miHuaNum as a double str = get(hObject,'string'); data = str2num(str); if isempty(data) % ÊäÈë²ÎÊýÓÐЧÐÔ¼ì²â errordlg('ÊäÈë±ØÐëΪÊýÖµ£¡','²ÎÊý´íÎó'); set(hObject,'BackgroundColor','r'); else set(hObject,'BackgroundColor','w'); set(hObject,'UserData',data); end % --- Executes during object creation, after setting all properties. function interpT_CreateFcn(hObject, eventdata, handles) % hObject handle to interpT (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function interpT_Callback(hObject, eventdata, handles) % hObject handle to interpT (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 interpT as text % str2double(get(hObject,'String')) returns contents of interpT as a double str = get(hObject,'string'); data = str2num(str); if isempty(data) % ÊäÈë²ÎÊýÓÐЧÐÔ¼ì²â errordlg('ÊäÈë±ØÐëΪÊýÖµ£¡','²ÎÊý´íÎó'); set(hObject,'BackgroundColor','r'); else set(hObject,'BackgroundColor','w'); set(hObject,'UserData',data); end % --- Executes during object creation, after setting all properties. function jinjiV_CreateFcn(hObject, eventdata, handles) % hObject handle to jinjiV (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function jinjiV_Callback(hObject, eventdata, handles) % hObject handle to jinjiV (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 jinjiV as text % str2double(get(hObject,'String')) returns contents of jinjiV as a double str = get(hObject,'string'); data = str2num(str); if isempty(data) % ÊäÈë²ÎÊýÓÐЧÐÔ¼ì²â errordlg('ÊäÈë±ØÐëΪÊýÖµ£¡','²ÎÊý´íÎó'); set(hObject,'BackgroundColor','r'); else set(hObject,'BackgroundColor','w'); set(hObject,'UserData',data); end % --- Executes during object creation, after setting all properties. function dataType_CreateFcn(hObject, eventdata, handles) % hObject handle to dataType (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in dataType. function dataType_Callback(hObject, eventdata, handles) % hObject handle to dataType (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 dataType contents as cell array % contents{get(hObject,'Value')} returns selected item from dataType % 1 - mat; 2 - txt ; 3 - dat datatype = get(hObject,'Value'); set(hObject,'UserData',datatype); % --- If Enable == 'on', executes on mouse press in 5 pixel border. % --- Otherwise, executes on mouse press in 5 pixel border or over clrLun. function clrLun_ButtonDownFcn(hObject, eventdata, handles) % hObject handle to clrLun (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % ÑÕÉ«ÉèÖô¦Àí color = uisetcolor; if length(color)~=1 % Èç¹ûѡȡÁËÑÕÉ« set(hObject,'BackgroundColor',color); hlunline = findobj(0,'tag','lunline'); if ~isempty(hlunline) % Èç¹ûÒÑ»æÖÆÍ¼Ïߣ¬Ôò°´ÕÕÉèÖõÄÑÕÉ«¸üÐÂͼÏß set(hlunline,'color',color); end end % --- If Enable == 'on', executes on mouse press in 5 pixel border. % --- Otherwise, executes on mouse press in 5 pixel border or over clrJin. function clrJin_ButtonDownFcn(hObject, eventdata, handles) % hObject handle to clrJin (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) color = uisetcolor; if length(color)~=1 set(hObject,'BackgroundColor',color); hjinline = findobj(0,'tag','jinline'); if ~isempty(hjinline) % Èç¹ûÒÑ»æÖÆÍ¼Ïߣ¬Ôò°´ÕÕÉèÖõÄÑÕÉ«¸üÐÂͼÏß set(hjinline,'color',color); end end % --- If Enable == 'on', executes on mouse press in 5 pixel border. % --- Otherwise, executes on mouse press in 5 pixel border or over clrCu. function clrCu_ButtonDownFcn(hObject, eventdata, handles) % hObject handle to clrCu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) color = uisetcolor; if length(color)~=1 set(hObject,'BackgroundColor',color); hculine = findobj(0,'tag','culine'); if ~isempty(hculine) % Èç¹ûÒÑ»æÖÆÍ¼Ïߣ¬Ôò°´ÕÕÉèÖõÄÑÕÉ«¸üÐÂͼÏß set(hculine,'color',color); end end % --- Executes on button press in chklun. function chklun_Callback(hObject, eventdata, handles) % hObject handle to chklun (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of chklun % ͼÏßµÄÏÔʾÒþ²Ø¸´Ñ¡¿ò val = get(hObject,'Value'); hlunline = findobj(0,'tag','lunline'); if ~isempty(hlunline) % Èç¹ûÒѾ»æÖÆÍ¼Ïß if val==1 % Èç¹ûÊÇÑ¡Öи´Ñ¡¿ò set(hlunline,'visible','on'); % ÏÔʾ else set(hlunline,'visible','off'); end chkLegend_Callback(handles.chkLegend,[], handles); % ¸üÐÂͼÁÐ end % --- Executes on button press in chkCu. function chkCu_Callback(hObject, eventdata, handles) % hObject handle to chkCu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of chkCu val = get(hObject,'Value'); hculine = findobj(0,'tag','culine'); if ~isempty(hculine) if val==1 set(hculine,'visible','on'); else set(hculine,'visible','off'); end chkLegend_Callback(handles.chkLegend,[], handles) end % --- Executes on button press in chkJin. function chkJin_Callback(hObject, eventdata, handles) % hObject handle to chkJin (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of chkJin val = get(hObject,'Value'); hjinline = findobj(0,'tag','jinline'); if ~isempty(hjinline) if val==1 set(hjinline,'visible','on'); else set(hjinline,'visible','off'); end chkLegend_Callback(handles.chkLegend,[], handles) end % --- Executes on button press in chkLegend. function chkLegend_Callback(hObject, eventdata, handles) % hObject handle to chkLegend (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of chkLegend % ͼÀý¸´Ñ¡¿òµÄ´¦Àí val = get(hObject,'Value'); if val ==1 % Èç¹ûÑ¡Öи´Ñ¡¿ò hjinline = findobj(0,'tag','jinline'); hculine = findobj(0,'tag','culine'); hlunline = findobj(0,'tag','lunline'); % ²âÊÔÊÇ·ñÒѾ»æÖÆÇúÏß ²¢ÇÒÇúÏßÊÇ·ñ¿É¼û jflag = ~isempty(hjinline) & (get(handles.chkJin,'value')); cflag = ~isempty(hculine) & (get(handles.chkCu,'value')); lflag = ~isempty(hlunline) & (get(handles.chklun,'value')); warning off MATLAB eprecatedLogicalAPI % ¹Ø±Õ¾¯¸æÐÅÏ¢£¬ÒòΪlflagµÈÊÇlogical£¬ÓÃnum2strÓо¯¸æstrflag = [num2str(lflag) num2str(cflag) num2str(jflag)]; switch strflag case '111', % È«²¿ legend([hlunline hculine hjinline],'ÍâÂÖÀªÏß','´Ö²å²¹µã','¾«²å²¹µã',2); % »æÖÆÍ¼Àý case '110' % ²»ÏÔʾ¾«²å²¹ legend([hlunline hculine],'ÍâÂÖÀªÏß','´Ö²å²¹µã',2) case '101', % ²»ÏÔʾ´Ö²å²¹ legend([hlunline hjinline],'ÍâÂÖÀªÏß','¾«²å²¹µã',2) case '011', % ²»ÏÔʾÂÖÀªÏß legend([hculine hjinline],'´Ö²å²¹µã','¾«²å²¹µã',2) case '100', legend(hlunline,'ÍâÂÖÀªÏß',2) case '001', legend(hjinline,'¾«²å²¹µã',2) case '010', legend(hculine,'´Ö²å²¹µã',2) otherwise legend off % ͼÀý²»ÏÔʾ end else legend off; % ͼÀý²»ÏÔʾ end % ²ÉÓõȽھàÎåµãÇóµ¼¹«Ê½µÄÖе㹫ʽÇóÊýֵ΢·Ö % ÕâÀï´æÔÚÒ»¸öÎÊÌâÊÇ£¬Êýֵ΢·ÖµÄʱºò£¬hµ½µ×ÈçºÎѡȡ£¿ % ×Ô¶¯Ñ¡È¡µÄËã·¨ÊÇÔõôÑùµÄ£¿Èç¹ûÒª×Ô¶¯Ñ¡È¡£¬ËÙ¶ÈÈçºÎ£¿ function dr = drdtheta( fcnname,theta0) % h = 0.001; theta_2 = theta0 - 2*h; theta_1 = theta0 - h; theta1 = theta0 + h; theta2 = theta0 + 2*h; theta = [theta_2 theta_1 theta1 theta2]; r = feval(fcnname,theta); dr = 1/(12*h)*(r(1) - 8*r(2) + 8*r(3) - r(4)); |
8Â¥2015-11-30 19:42:54
ÍûÔÂÈÎ
гæ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 492.6
- É¢½ð: 30
- Ìû×Ó: 141
- ÔÚÏß: 66.9Сʱ
- ³æºÅ: 3888752
- ×¢²á: 2015-05-25
- ÐÔ±ð: GG
- רҵ: »úе¹¤³Ì
|
function varargout = DemoGUI(varargin) % DEMOGUI M-file for DemoGUI.fig % DEMOGUI, by itself, creates a new DEMOGUI or raises the existing % singleton*. % % H = DEMOGUI returns the handle to a new DEMOGUI or the handle to % the existing singleton*. % % DEMOGUI('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in DEMOGUI.M with the given input arguments. % % DEMOGUI('Property','Value',...) creates a new DEMOGUI or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before DemoGUI_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to DemoGUI_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 DemoGUI % Last Modified by GUIDE v2.5 16-Apr-2005 18:42:13 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @DemoGUI_OpeningFcn, ... 'gui_OutputFcn', @DemoGUI_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && isstr(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 DemoGUI is made visible. function DemoGUI_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 DemoGUI (see VARARGIN) % Choose default command line output for DemoGUI handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes DemoGUI wait for user response (see UIRESUME) % uiwait(handles.DemoFig); % ÈÕÆÚʱ¼äÏÔʾ set(handles.timestr,'string',datestr(now,0)); htimer = timer('StartDelay',1,'TimerFcn',... 'htimestr=findall(0,''tag'',''timestr'');set(htimestr,''string'',datestr(now,0));',... 'Period',1,'ExecutionMode','fixedSpacing','tag','showtime'); start(htimer); set(hObject,'doublebuffer','on'); % --- Outputs from this function are returned to the command line. function varargout = DemoGUI_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 ExitBtn. function ExitBtn_Callback(hObject, eventdata, handles) % hObject handle to ExitBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) selection = questdlg(['Í˳ö ' get(handles.DemoFig,'Name') '?'],... ['Í˳ö ' get(handles.DemoFig,'Name') '...'],... 'ÊÇ','·ñ','ÊÇ'); if strcmp(selection,'·ñ') return; end htimer = timerfind('tag','showtime'); stop(htimer); delete(htimer); delete(handles.DemoFig); % --- Executes on button press in HelpBtn. function HelpBtn_Callback(hObject, eventdata, handles) % hObject handle to HelpBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % str={'¶Ô²»Æð£¬Ä¿Ç°ÉÐδÍê³É˵Ã÷Îļþ';' ´òË㾡¿ìÍêÉÆÕû¸öϵͳ¹¦Äܼ°ÆäʹÓÃ˵Ã÷'}; % msgbox(str,'ʹÓðïÖú','help','non-modal'); !CNCHelp.CHM % ¾«²å²¹°´Å¥»Øµ÷º¯Êý % --- Executes on button press in JinBtn. function JinBtn_Callback(hObject, eventdata, handles) % hObject handle to JinBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % »ñÈ¡ÉèÖõIJÎÊýÖµ theta0 = get(handles.startRad,'UserData'); % ÍâÂÖÀªÆðʼµã¼«½Ç thetat = get(handles.endRad,'UserData'); % ÍâÂÖÀªÖÐÖ¹µã¼«½Ç interpTime = get(handles.interpT,'UserData'); % ²å²¹ÖÜÆÚ ms mihuaNum = get(handles.miHuaNum,'UserData'); % ÃÜ»¯µãÊý jinjiV = get(handles.jinjiV,'UserData'); % ½ø¸øËÙ¶È mm/min jinjiV = jinjiV/60; % ½ø¸øËÙ¶Èmm/sec clrjinline = get(handles.clrJin,'BackgroundColor'); % ¾«²åÖµµãÏßÑÕÉ« % »ñÈ¡ÍâÂÖÀªº¯ÊýÃû filename = get(handles.SelectFcnBtn,'UserData'); if isempty(filename) msgbox('ûÓÐѡȡÂÖÀªº¯Êý£¡','²Ù×÷´íÎó'); return; end [pathstr,fcnname] = fileparts(filename); %»ñµÃÎļþÃûÓë·¾¶Ãû % ÅжÏÊÇ˳Բ»¹ÊÇÄæÔ²²å²¹,ʵÏÖ²»¹Ü˳Բ»¹ÊÇÄæÔ²¶¼¿ÉÓ㨲»¹ýÖ»²âÊÔÁË˳Բ££ÄæÊ±Õë²å²¹£© if theta0>thetat % ÄæÔ² flag = -1; else % ˳Բ flag = 1; end set(gcf,'doublebuffer','on'); axis(handles.axes2); % ÉèÖÃaxes2Ϊµ±Ç°×ø±êÖá hjinline = line('color',clrjinline,'marker','.','markersize',4,... 'visible','off', 'tag','jinline'); % ´´½¨´Ö²åÖµÏß¶ÔÏó culinedata = getappdata(handles.CuBtn,'culinedata'); % »ñÈ¡´Ö²å²¹ÏßÊý¾Ý cutheta = culinedata(:,1); % ¼«½Ç curho = culinedata(:,2); % ¼«¾¶ numCu = length(culinedata); % ´Ö²å²¹µãÊý theta = []; r = []; set(hjinline,'visible','on'); outflag = 0; % hbar = waitbar(0,'Please wait...','name','¾«²å²¹½øÐÐÖÐ'); for k = 1:numCu-1 % ¶Ôÿ¶Î´Ö²å²¹Çé¿ö tmptheta = cutheta(k); % theta0 rr0 = curho(k); % rho0 theta = [theta tmptheta]; r = [r rr0]; [xd,yd] = pol2cart(theta,r); % ¼«×ø±ê±ä³ÉÆ½ÃæÖ±½Ç×ø±ê set(hjinline,'xdata',xd,'ydata',yd); for n = 2:mihuaNum % ¼ÆËãÿ¶Î´Ö²å²¹ÖÐÃÜ»¯µã×ø±ê drda = drdtheta(fcnname,tmptheta); % ¼ÆËã¸ÃµãµÄÊýֵ΢·Ö deletatheta = interpTime/1000*jinjiV/(drda^2+rr0^2)^(0.5); % ¼ÆËãdeltatheta tmptheta = flag*deletatheta+tmptheta; % µü´úÇóÈ¡ÏÂÒ»¸ö¼«½Ç if flag*tmptheta>flag*cutheta(end) % ¶ÔÓÚ×îºóÒ»¶ÎµÄÌØÊâ´¦Àí,ÒòΪ×îºóÒ»¶Î¿ÉÄܱÈÒÔǰµÄ¶Ì tmptheta = cutheta(end); % ÊDz»Äܹ»²åÈënum¸öÃÜ»¯µãµÄ outflag = 1; end rr0 = feval(fcnname,tmptheta); theta = [theta tmptheta]; r = [r rr0]; [xd,yd] = pol2cart(theta,r); set(hjinline,'xdata',xd,'ydata',yd); if outflag==1 break; % ×îºóÒ»¶ÎÌØÊâ´¦ÀíÊ±Ìø³öÑ»· end end % waitbar(k/(numCu-1),hbar); end % close(hbar); theta = [theta cutheta(end)]; r = [r curho(end)]; jinlinedata = [theta( r( ];setappdata(hObject,'jinlinedata',jinlinedata); % ±£´æ¾«²å²¹ÏßÊý¾Ýµ½¾ä±úÖÐ set(handles.chkJin,'enable','on'); % ʹµÃÏÔʾÒþ²ØÏ߸´Ñ¡¿ò¿ÉÓà chkLegend_Callback(handles.chkLegend,[], handles); % ´Ö²å²¹°´Å¥»Øµ÷º¯Êý % --- Executes on button press in CuBtn. function CuBtn_Callback(hObject, eventdata, handles) % hObject handle to CuBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % »ñÈ¡ÉèÖõIJÎÊýÖµ theta0 = get(handles.startRad,'UserData'); % ÍâÂÖÀªÆðʼµã¼«½Ç thetat = get(handles.endRad,'UserData'); % ÍâÂÖÀªÖÐÖ¹µã¼«½Ç interpTime = get(handles.interpT,'UserData'); % ²å²¹ÖÜÆÚ ms jinjiV = get(handles.jinjiV,'UserData'); % ½ø¸øËÙ¶È mm/min jinjiV = jinjiV/60; % ½ø¸øËÙ¶Èmm/sec clrlunline = get(handles.clrLun,'BackgroundColor'); % ÂÖÀªÏßÑÕÉ« clrculine = get(handles.clrCu,'BackgroundColor'); % ´Ö²åÖµµãÏßÑÕÉ« % »ñÈ¡ÍâÂÖÀªº¯ÊýÃû filename = get(handles.SelectFcnBtn,'UserData'); if isempty(filename) msgbox('ûÓÐѡȡÂÖÀªº¯Êý£¡','²Ù×÷´íÎó'); return; end [pathstr,fcnname] = fileparts(filename); addpath(pathstr,'-begin'); % ½«ÍâÂÖÀªº¯ÊýËùÔÚ·¾¶¼ÓÈëmatlab·¾¶ÖÐ set(handles.chklun,'enable','on'); % ʹ¸´Ñ¡¿ò¿ÉÓà set(handles.chkLegend,'enable','on'); % ʹ¸´Ñ¡¿ò¿ÉÓà set(handles.chkCu,'enable','on'); % ʹ¸´Ñ¡¿ò¿ÉÓà % »æÖÆÍâÂÖÀªÏß theta = linspace(theta0,thetat,1000); r = feval(fcnname,theta); % ¼ÆËãÍâÂÖÀª if length(r)~=length(theta) % ͨ³£ÊÇÓÉÓÚÍâÂÖÀªº¯Êý²»¶ÔÔì³É msgbox('ÍâÂÖÀªº¯Êý´íÎó','³ö´íÁË...'); return; end axis(handles.axes2); hlunline = polar(theta,r); set(hlunline,'color',clrlunline,'tag','lunline'); % ÉèÖÃtagÒÔºóºÃÓà lundata = [theta( r( ];setappdata(hObject,'lundata',lundata); % ±£´æÂÖÀªÏßÊý¾Ýµ½¾ä±úÖÐ hold on; hculine = line('color',clrculine,'marker','.','markersize',10,... 'tag','culine'); % ´Ö²åÖµÏß¶ÔÏó 'erasemode','xor', hold off; theta = []; r = []; % ÅжÏÊÇ˳Բ»¹ÊÇÄæÔ²²å²¹,ʵÏÖ²»¹Ü˳Բ»¹ÊÇÄæÔ²¶¼¿ÉÓ㨲»¹ýÖ»²âÊÔÁË˳Բ££ÄæÊ±Õë²å²¹£© if theta0>thetat % ÄæÔ² flag = -1; else % ˳Բ flag = 1; end tmptheta = theta0; while flag*tmptheta<flag*thetat % ÖÕÖ¹Åжϣ¬¿¼ÂÇÁË˳ԲÓëÄæÔ² rr0 = feval(fcnname,tmptheta); % ¼ÆËãÍâÂÖÀª¸Ã¼«½Ç³öµÄ¼«¾¶ theta = [theta tmptheta]; r = [r rr0]; [xd,yd] = pol2cart(theta,r); % ת»»ÎªÖ±½Ç×ø±êϵÊýÖµ set(hculine,'xdata',xd,'ydata',yd); % ¸üвåÖµµã drda = drdtheta(fcnname,tmptheta); % ¼ÆËã¸Ã¼«½Ç´¦Êýֵ΢·Ö deletatheta = interpTime/1000*jinjiV/(drda^2+rr0^2)^(0.5); tmptheta = flag*deletatheta+tmptheta; % µü´úÇóÈ¡ÏÂÒ»¸öµã¼«½Ç end rr0 = feval(fcnname,thetat); % ÖÕµã¼ÓÈë theta = [theta thetat]; r = [r rr0]; culinedata = [theta( r( ];setappdata(hObject,'culinedata',culinedata); % ±£´æ´Ö²å²¹ÏßÊý¾Ýµ½¾ä±úÖÐ set(handles.ExportDataBtn,'enable','on'); set(handles.JinBtn,'enable','on'); chkLegend_Callback(handles.chkLegend,[], handles); % µ÷ÓÃͼÀý¸´Ñ¡¿òµÄ»Øµôº¯Êý % --- Executes during object creation, after setting all properties. function FcnName_CreateFcn(hObject, eventdata, handles) % hObject handle to FcnName (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on button press in SelectFcnBtn. function SelectFcnBtn_Callback(hObject, eventdata, handles) % hObject handle to SelectFcnBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) [filename, pathname] = uigetfile('*.m', 'ѡȡÍâÂÖÀªÏßMÎļþ'); if filename~=0 set(handles.FcnName,'string',filename); set(hObject,'UserData',[pathname filename]); set(handles.JinBtn,'enable','off'); set(handles.ExportDataBtn,'enable','off'); set(handles.chklun,'enable','off'); set(handles.chkCu,'enable','off'); set(handles.chkJin,'enable','off'); set(handles.chkLegend,'value',0,'enable','off'); axis(handles.axes2); cla chkLegend_Callback(handles.chkLegend,[], handles); % ¸üÐÂͼÁÐ else set(handles.FcnName,'string','ÉÐδѡȡ'); end % --- Executes on button press in ExportDataBtn. function ExportDataBtn_Callback(hObject, eventdata, handles) % hObject handle to ExportDataBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % str={'¶Ô²»Æð£¬Ä¿Ç°ÉÐδÍê³É˵Ã÷Îļþ';' ´òË㾡¿ìÍêÉÆÕû¸öϵͳ¹¦Äܼ°ÆäʹÓÃ˵Ã÷'}; % msgbox(str,'ʹÓðïÖú','help','non-modal'); type = get(handles.dataType,'UserData'); % »ñÈ¡ÉèÖõĵ¼³öÊý¾Ý¸ñʽ 1-mat,2-txt,3-dat % % »ñÈ¡¸÷ÖÖͼÏߵľä±ú % hjinline = findobj(0,'tag','jinline'); % hculine = findobj(0,'tag','culine'); % hlunline = findobj(0,'tag','lunline'); % ±£´æÊ± % % handles.CuBtn % setappdata(hObject,'culinedata',culinedata); % ±£´æ´Ö²å²¹ÏßÊý¾Ýµ½¾ä±úÖÐ % setappdata(hObject,'lundata',lundata); % ±£´æÂÖÀªÏßÊý¾Ýµ½¾ä±úÖÐ % % handles.JinBtn % setappdata(hObject,'jinlinedata',jinlinedata); % ±£´æ¾«²å²¹ÏßÊý¾Ýµ½¾ä±úÖÐ lundata = getappdata(handles.CuBtn,'lundata'); culinedata = getappdata(handles.CuBtn,'culinedata'); jinlinedata = getappdata(handles.JinBtn,'jinlinedata'); switch type case 1, [filename, pathname] = uiputfile('*.mat', '±£´æ²å²¹½á¹û'); if filename==0 % È¡Ïû return; end save([pathname filename],'lundata','culinedata','jinlinedata'); case 2, [filename, pathname] = uiputfile('*.txt', '±£´æ²å²¹½á¹û'); if filename==0 return; end [pathstr,filename]=fileparts(filename); fid = fopen([pathname filename,'.txt'],'w'); fprintf(fid,'\n£¥=================%s=================\r\n',datestr(now,0)); fprintf(fid,'£¥ÔʼÍâÂÖÀªÏßÊý¾Ý\r\n'); fprintf(fid,'£¥ ¼«½Ç \t ¼«¾¶\r\n'); fprintf(fid,'%8.6f \t %8.6f\r\n',lundata'); fprintf(fid,'£¥´Ö²å²¹µãÊý¾Ý\r\n'); fprintf(fid,'£¥ ¼«½Ç \t ¼«¾¶\r\n'); fprintf(fid,'%8.6f \t %8.6f\r\n',culinedata'); fprintf(fid,'£¥¾«²å²¹µãÊý¾Ý\r\n'); fprintf(fid,'£¥ ¼«½Ç \t ¼«¾¶\r\n'); fprintf(fid,'%8.6f \t %8.6f\r\n',jinlinedata'); fclose(fid); case 3, [filename, pathname] = uiputfile('*.dat', '±£´æ²å²¹½á¹û'); if filename==0 return; end [pathstr,filename]=fileparts(filename); save([pathname filename,'.dat'],'lundata','culinedata','jinlinedata','-ascii','-double'); otherwise, msgbox('ÕÕµÀÀíÊDz»»á³öÏÖµÄ~'); end % --- Executes on button press in ResetBtn. function ResetBtn_Callback(hObject, eventdata, handles) % hObject handle to ResetBtn (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % ÉèÖø÷ÖÖ²ÎÊýΪĬÈÏÖµ set(handles.startRad,'string','0','UserData',0); set(handles.endRad,'string','2*pi','UserData',2*pi); set(handles.miHuaNum,'string','4','UserData',4); set(handles.interpT,'string','8','UserData',8); set(handles.jinjiV,'string','4000','UserData',4000); set(handles.clrLun,'BackgroundColor',[0 0 0]); set(handles.clrCu,'BackgroundColor',[0 0 1]); set(handles.clrJin,'BackgroundColor',[1 1 0.5]); set(handles.dataType,'value',1,'UserData',1); set(handles.chkLegend,'value',0,'UserData',0); % --- Executes during object creation, after setting all properties. function startRad_CreateFcn(hObject, eventdata, handles) % hObject handle to startRad (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function startRad_Callback(hObject, eventdata, handles) % hObject handle to startRad (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 startRad as text % str2double(get(hObject,'String')) returns contents of startRad as a double str = get(hObject,'string'); data = str2num(str); if isempty(data) % ÊäÈë²ÎÊýÓÐЧÐÔ¼ì²â errordlg('ÊäÈë±ØÐëΪÊýÖµ£¡','²ÎÊý´íÎó'); set(hObject,'BackgroundColor','r'); else set(hObject,'BackgroundColor','w'); set(hObject,'UserData',data); end % --- Executes during object creation, after setting all properties. function endRad_CreateFcn(hObject, eventdata, handles) % hObject handle to endRad (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function endRad_Callback(hObject, eventdata, handles) % hObject handle to endRad (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 endRad as text % str2double(get(hObject,'String')) returns contents of endRad as a double str = get(hObject,'string'); data = str2num(str); if isempty(data) % ÊäÈë²ÎÊýÓÐЧÐÔ¼ì²â errordlg('ÊäÈë±ØÐëΪÊýÖµ£¡','²ÎÊý´íÎó'); set(hObject,'BackgroundColor','r'); else set(hObject,'BackgroundColor','w'); set(hObject,'UserData',data); end % --- Executes during object creation, after setting all properties. function miHuaNum_CreateFcn(hObject, eventdata, handles) % hObject handle to miHuaNum (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function miHuaNum_Callback(hObject, eventdata, handles) % hObject handle to miHuaNum (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 miHuaNum as text % str2double(get(hObject,'String')) returns contents of miHuaNum as a double str = get(hObject,'string'); data = str2num(str); if isempty(data) % ÊäÈë²ÎÊýÓÐЧÐÔ¼ì²â errordlg('ÊäÈë±ØÐëΪÊýÖµ£¡','²ÎÊý´íÎó'); set(hObject,'BackgroundColor','r'); else set(hObject,'BackgroundColor','w'); set(hObject,'UserData',data); end % --- Executes during object creation, after setting all properties. function interpT_CreateFcn(hObject, eventdata, handles) % hObject handle to interpT (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function interpT_Callback(hObject, eventdata, handles) % hObject handle to interpT (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 interpT as text % str2double(get(hObject,'String')) returns contents of interpT as a double str = get(hObject,'string'); data = str2num(str); if isempty(data) % ÊäÈë²ÎÊýÓÐЧÐÔ¼ì²â errordlg('ÊäÈë±ØÐëΪÊýÖµ£¡','²ÎÊý´íÎó'); set(hObject,'BackgroundColor','r'); else set(hObject,'BackgroundColor','w'); set(hObject,'UserData',data); end % --- Executes during object creation, after setting all properties. function jinjiV_CreateFcn(hObject, eventdata, handles) % hObject handle to jinjiV (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function jinjiV_Callback(hObject, eventdata, handles) % hObject handle to jinjiV (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 jinjiV as text % str2double(get(hObject,'String')) returns contents of jinjiV as a double str = get(hObject,'string'); data = str2num(str); if isempty(data) % ÊäÈë²ÎÊýÓÐЧÐÔ¼ì²â errordlg('ÊäÈë±ØÐëΪÊýÖµ£¡','²ÎÊý´íÎó'); set(hObject,'BackgroundColor','r'); else set(hObject,'BackgroundColor','w'); set(hObject,'UserData',data); end % --- Executes during object creation, after setting all properties. function dataType_CreateFcn(hObject, eventdata, handles) % hObject handle to dataType (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in dataType. function dataType_Callback(hObject, eventdata, handles) % hObject handle to dataType (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 dataType contents as cell array % contents{get(hObject,'Value')} returns selected item from dataType % 1 - mat; 2 - txt ; 3 - dat datatype = get(hObject,'Value'); set(hObject,'UserData',datatype); % --- If Enable == 'on', executes on mouse press in 5 pixel border. % --- Otherwise, executes on mouse press in 5 pixel border or over clrLun. function clrLun_ButtonDownFcn(hObject, eventdata, handles) % hObject handle to clrLun (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % ÑÕÉ«ÉèÖô¦Àí color = uisetcolor; if length(color)~=1 % Èç¹ûѡȡÁËÑÕÉ« set(hObject,'BackgroundColor',color); hlunline = findobj(0,'tag','lunline'); if ~isempty(hlunline) % Èç¹ûÒÑ»æÖÆÍ¼Ïߣ¬Ôò°´ÕÕÉèÖõÄÑÕÉ«¸üÐÂͼÏß set(hlunline,'color',color); end end % --- If Enable == 'on', executes on mouse press in 5 pixel border. % --- Otherwise, executes on mouse press in 5 pixel border or over clrJin. function clrJin_ButtonDownFcn(hObject, eventdata, handles) % hObject handle to clrJin (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) color = uisetcolor; if length(color)~=1 set(hObject,'BackgroundColor',color); hjinline = findobj(0,'tag','jinline'); if ~isempty(hjinline) % Èç¹ûÒÑ»æÖÆÍ¼Ïߣ¬Ôò°´ÕÕÉèÖõÄÑÕÉ«¸üÐÂͼÏß set(hjinline,'color',color); end end % --- If Enable == 'on', executes on mouse press in 5 pixel border. % --- Otherwise, executes on mouse press in 5 pixel border or over clrCu. function clrCu_ButtonDownFcn(hObject, eventdata, handles) % hObject handle to clrCu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) color = uisetcolor; if length(color)~=1 set(hObject,'BackgroundColor',color); hculine = findobj(0,'tag','culine'); if ~isempty(hculine) % Èç¹ûÒÑ»æÖÆÍ¼Ïߣ¬Ôò°´ÕÕÉèÖõÄÑÕÉ«¸üÐÂͼÏß set(hculine,'color',color); end end % --- Executes on button press in chklun. function chklun_Callback(hObject, eventdata, handles) % hObject handle to chklun (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of chklun % ͼÏßµÄÏÔʾÒþ²Ø¸´Ñ¡¿ò val = get(hObject,'Value'); hlunline = findobj(0,'tag','lunline'); if ~isempty(hlunline) % Èç¹ûÒѾ»æÖÆÍ¼Ïß if val==1 % Èç¹ûÊÇÑ¡Öи´Ñ¡¿ò set(hlunline,'visible','on'); % ÏÔʾ else set(hlunline,'visible','off'); end chkLegend_Callback(handles.chkLegend,[], handles); % ¸üÐÂͼÁÐ end % --- Executes on button press in chkCu. function chkCu_Callback(hObject, eventdata, handles) % hObject handle to chkCu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of chkCu val = get(hObject,'Value'); hculine = findobj(0,'tag','culine'); if ~isempty(hculine) if val==1 set(hculine,'visible','on'); else set(hculine,'visible','off'); end chkLegend_Callback(handles.chkLegend,[], handles) end % --- Executes on button press in chkJin. function chkJin_Callback(hObject, eventdata, handles) % hObject handle to chkJin (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of chkJin val = get(hObject,'Value'); hjinline = findobj(0,'tag','jinline'); if ~isempty(hjinline) if val==1 set(hjinline,'visible','on'); else set(hjinline,'visible','off'); end chkLegend_Callback(handles.chkLegend,[], handles) end % --- Executes on button press in chkLegend. function chkLegend_Callback(hObject, eventdata, handles) % hObject handle to chkLegend (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of chkLegend % ͼÀý¸´Ñ¡¿òµÄ´¦Àí val = get(hObject,'Value'); if val ==1 % Èç¹ûÑ¡Öи´Ñ¡¿ò hjinline = findobj(0,'tag','jinline'); hculine = findobj(0,'tag','culine'); hlunline = findobj(0,'tag','lunline'); % ²âÊÔÊÇ·ñÒѾ»æÖÆÇúÏß ²¢ÇÒÇúÏßÊÇ·ñ¿É¼û jflag = ~isempty(hjinline) & (get(handles.chkJin,'value')); cflag = ~isempty(hculine) & (get(handles.chkCu,'value')); lflag = ~isempty(hlunline) & (get(handles.chklun,'value')); warning off MATLAB eprecatedLogicalAPI % ¹Ø±Õ¾¯¸æÐÅÏ¢£¬ÒòΪlflagµÈÊÇlogical£¬ÓÃnum2strÓо¯¸æstrflag = [num2str(lflag) num2str(cflag) num2str(jflag)]; switch strflag case '111', % È«²¿ legend([hlunline hculine hjinline],'ÍâÂÖÀªÏß','´Ö²å²¹µã','¾«²å²¹µã',2); % »æÖÆÍ¼Àý case '110' % ²»ÏÔʾ¾«²å²¹ legend([hlunline hculine],'ÍâÂÖÀªÏß','´Ö²å²¹µã',2) case '101', % ²»ÏÔʾ´Ö²å²¹ legend([hlunline hjinline],'ÍâÂÖÀªÏß','¾«²å²¹µã',2) case '011', % ²»ÏÔʾÂÖÀªÏß legend([hculine hjinline],'´Ö²å²¹µã','¾«²å²¹µã',2) case '100', legend(hlunline,'ÍâÂÖÀªÏß',2) case '001', legend(hjinline,'¾«²å²¹µã',2) case '010', legend(hculine,'´Ö²å²¹µã',2) otherwise legend off % ͼÀý²»ÏÔʾ end else legend off; % ͼÀý²»ÏÔʾ end % ²ÉÓõȽھàÎåµãÇóµ¼¹«Ê½µÄÖе㹫ʽÇóÊýֵ΢·Ö % ÕâÀï´æÔÚÒ»¸öÎÊÌâÊÇ£¬Êýֵ΢·ÖµÄʱºò£¬hµ½µ×ÈçºÎѡȡ£¿ % ×Ô¶¯Ñ¡È¡µÄËã·¨ÊÇÔõôÑùµÄ£¿Èç¹ûÒª×Ô¶¯Ñ¡È¡£¬ËÙ¶ÈÈçºÎ£¿ function dr = drdtheta( fcnname,theta0) % h = 0.001; theta_2 = theta0 - 2*h; theta_1 = theta0 - h; theta1 = theta0 + h; theta2 = theta0 + 2*h; theta = [theta_2 theta_1 theta1 theta2]; r = feval(fcnname,theta); dr = 1/(12*h)*(r(1) - 8*r(2) + 8*r(3) - r(4)); |
9Â¥2015-11-30 19:43:42
ÍûÔÂÈÎ
гæ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 492.6
- É¢½ð: 30
- Ìû×Ó: 141
- ÔÚÏß: 66.9Сʱ
- ³æºÅ: 3888752
- ×¢²á: 2015-05-25
- ÐÔ±ð: GG
- רҵ: »úе¹¤³Ì
Ëͺ컨һ¶ä |
Ö±½Ó¸ø´úÂë»áÓÐÂÒÂ룬¸øÄ㸽¼þ°É£¬Ð»Ð» |
» ±¾Ìû¸½¼þ×ÊÔ´Áбí
-
»¶Ó¼à¶½ºÍ·´À¡£ºÐ¡Ä¾³æ½öÌṩ½»Á÷ƽ̨£¬²»¶Ô¸ÃÄÚÈݸºÔð¡£
±¾ÄÚÈÝÓÉÓû§×ÔÖ÷·¢²¼£¬Èç¹ûÆäÄÚÈÝÉæ¼°µ½ÖªÊ¶²úȨÎÊÌ⣬ÆäÔðÈÎÔÚÓÚÓû§±¾ÈË£¬Èç¶Ô°æÈ¨ÓÐÒìÒ飬ÇëÁªÏµÓÊÏ䣺xiaomuchong@tal.com - ¸½¼þ 1 : DemoGUI.m
2015-11-30 19:45:12, 27.36 K
10Â¥2015-11-30 19:46:03













»Ø¸´´ËÂ¥
r(
eprecatedLogicalAPI % ¹Ø±Õ¾¯¸æÐÅÏ¢£¬ÒòΪlflagµÈÊÇlogical£¬ÓÃnum2strÓо¯¸æ