

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、Cqj z.mfunction num,den=cqjz(G,kc,yPm G=tf(G;mag,pha,w=bode(G*kc;Mag=20*log10(mag;Gm,Pm,Wcg,Wcp=margi n(G*kc;%phi=(yPm-getfield(Pm,Wcg*pi/180; phi=(yPm+5-Pm*pi/180;alpha=(1+s in( phi/(1-s in( phi;Mn=-10*log10(alpha;Wcg n=spli ne(Mag,w,M n;T=1/(Wcg n*sqrt(alpha;Tz=alpha*T;num=T z,1;den=T,1;keshe.mfun
2、 ctio n varargout = keshe(varargin% KESHE M-file for keshe.fig% KESHE, by itself, creates a new KESHE or raises the existing% sin glet on*.% H = KESHE returns the han dle to a new KESHE or the han dle to% the existi ng sin glet on*.% KESHE(CALLBACK,hObject,eve ntData,ha ndles,. calls the local % fun
3、ction named CALLBACK in KESHE.M with the give n in put argume nts. % KESHE(Property,Value,. creates a new KESHE or raises the % existingsingleton*. Starting from the left, property value pairs are% applied to the GUI before keshe_Ope ningFun cti on gets called. An %un recog ni zed property n ame or
4、in valid value makes property applicati on% stop. All in puts are passed to keshe_Ope nin gFc n via vararg in.% *See GUI Optio ns on GUIDEs Tools me nu. Choose GUI allows only one% in sta nee to run (sin glet on.% See also: GUIDE, GUIDATA, GUIHANDLES% Copyright 2002-2003 The MathWorks, I nc.% Edit t
5、he above text to modify the resp onse to help keshe% Last Modified by GUIDE v2.5 30-Dec-2009 18:31:42function keshe_Ope nin gFc n( hObject, eve ntdata, han dles, vararg in% This function has no output args, see OutputFc n.% Begin initialization code - DO NOT EDITgui_S in glet on = 1;gui_State = stru
6、ct(gui_Name, mfile name, .gui_S in glet on, gui_S in glet on,gui_Ope nin gFc n, keshe_Ope nin gFc n,gui_OutputFc n, keshe_OutputFc n,gui_LayoutFc n,.gui_Callback,;if n argin & ischar(varargi n1gui_State.gui_Callback = str2fu nc(varargi n1;endif n argoutvarargout1: nargout = gui_mai nfcn( gui_Sta
7、te, vararg in :; else gui_mainfcn( gui_State, varargi n:;end% End initialization code - DO NOT EDIT% - Executes just before keshe is made visible.% hObject han die to figure% eve ntdata reserved - to be defi ned in a future versi on of MATLAB % han diesstructure with han dies and user data (see GUID
8、ATA% varargin comma nd line argume nts to keshe (see VARARGIN% Choose default comma nd line output for keshehan dles.output = hObject;% Update han dles structureguidata(hObject, han dles;% UIWAIT makes keshe wait for user respo nse (see UIRESUME% uiwait(ha ndles.figurel;% - Outputs from this fun cti
9、o n are returned to the comma nd line, fun ctio nvarargout = keshe_OutputFc n( hObject, eve ntdata, han dles% varargout cell array for returni ng output args (see VARARGOUT;% hObject han dle to figure% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han d
10、les and user data (see GUIDATA% Get default comma nd line output from han dles structurevarargout1 = han dles.output;% - Executes on butt on press in pushbutt on1.bode(c onv (ha ndles .nu m,ha ndles.f nu m,c onv (ha ndles.de n,ha ndles.fde n;xlabel(Freque ncy rad/s,fo ntsize,10;ylabel(Phase deg Gain
11、 dB,fontsize,10;function pushbutt on 1_Callback(hObject, eve ntdata, han dies% hObject handle to pushbutt on1 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dies structure with han dies and user data (see GUIDATA figure(2bode(ha ndles .nu mh,ha ndles.de nh;xlabel
12、(Freque ncy rad/s,fo ntsize,10;ylabel(Phase deg Gain dB,fontsize,10;title(Bode Diagram of original signal;guidata(hObject,ha ndles;% - Executes on butt on press in pushbutt on2.function pushbutt on 2_Callback(hObject, eve ntdata, han dles% hObject handle to pushbutt on2 (see GCBO% eve ntdata reserve
13、d - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATA figure(1title(Bode Diagram of original signal;guidata(hObject,ha ndles;function edit1_Callback(hObject, eventdata, handles% hObject han dle to edit1 (see GCBO% eve ntdata reserved - to be d
14、efi ned in a future versi on of MATLAB% Hint: edit con trols usually have a white backgro und on Win dows.% See ISPC and COMPUTER.% han dles structure with han dles and user data (see GUIDATA% Hin ts: get(hObject,Stri ng retur ns contents of edit1 as text% str2double(get(hObject,Stri ng retur ns con
15、tents of edit1 as a% double_num=get(hObject,Stri ng;han dles .num=str2 num(num;guidata(hObject, han dles;% - Executes during object creation, after setting all properties. functionedit1_CreateFc n( hObject, eve ntdata, han dles% hObject han dle to edit1 (see GCBO% eve ntdata reserved - to be defi ne
16、d in a future versi on of MATLAB% han dles empty - han dles not created un til after all CreateFc ns calledif ispcset(hObject,Backgro un dColor,white;elseset(hObject,Backgro un dColor,get(0,defaultUico ntrolBackgro un dColor;endfunction edit2_Callback(hObject, eventdata, handles% hObject han dle to
17、edit2 (see GCBO% hObject han dle to edit2 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATA% Hints: get(hObject,String returns contents of ed
18、it2 as text% str2double(get(hObject,String returns contents of edit2 as a% doubleden=get(hObject,Stri ng;han dles.de n=str2 nu m(de n;guidata(hObject, han dles;% - Executes during object creation, after setting all properties. functionedit2_CreateFcn(hObject, eventdata, handles% han dies empty - han
19、 dies not created un til after all CreateFc ns called% han dles empty - han dles not created un til after all CreateFc ns called% Hint: edit con trols usually have a white backgro und on Win dows.% See ISPC and COMPUTER.if ispcset(hObject,Backgro un dColor,white;elseset(hObject,Backgro un dColor,get
20、(0,defaultUico ntrolBackgro undColor;endfunction edit3_Callback(hObject, eventdata, handles% hObject han dle to edit3 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATA% Hints: get(hObject,String returns content
21、s of edit3 as text% str2double(get(hObject,String returns contents of edit3 as a double% - Executes during object creation, after setting all properties. functionedit3_CreateFc n( hObject, eve ntdata, han dles% hObject han dle to edit3 (see GCBO% han dies empty - han dies not created un til after al
22、l CreateFc ns called% han dles empty - han dles not created un til after all CreateFc ns called% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles empty - han dles not created un til after all CreateFc ns called% Hint: edit con trols usually have a white backgro und on Wi
23、n dows.% Hint: edit con trols usually have a white backgro und on Win dows.% See ISPC and COMPUTER.if ispcset(hObject,Backgro un dColor,white;elseset(hObject,Backgro un dColor,get(0,defaultUico ntrolBackgro undColor;endfunction edit4_Callback(hObject, eventdata, handles% hObject han dle to edit4 (se
24、e GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATA% Hints: get(hObject,String returns contents of edit4 as text% str2double(get(hObject,String returns contents of edit4 as a double% - Executes during object creatio
25、n, after setting all properties. functionedit4_CreateFcn(hObject, eventdata, handles% hObject han dle to edit4 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% hObject han dle to edit6 (see GCBO% See ISPC and COMPUTER.if ispcset(hObject,Backgro un dColor,white;elseset(
26、hObject,Backgro un dColor,get(0,defaultUico ntrolBackgro undColor;endfunction edit6_Callback(hObject, eventdata, handles% hObject han dle to edit6 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATA% Hints: get(h
27、Object,String returns contents of edit6 as text% str2double(get(hObject,String returns contents of edit6 as a doublepm=get(hObject,Stri ng;han dles.pm=str2 nu m(pm;guidata(hObject, han dles;% - Executes during object creation, after setting all properties. functionedit6_CreateFcn(hObject, eventdata,
28、 handles% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dies empty - han dies not created un til after all CreateFc ns callededit7_CreateFc n( hObject, eve ntdata, han dles% Hint: edit con trols usually have a white backgro und on Win dows.% See ISPC and COMPUTER.if ispcse
29、t(hObject,Backgro un dColor,white;elseset(hObject,Backgro un dColor,get(0,defaultUico ntrolBackgro undColor;endfun ctio n edit7_Callback(hObject, eve ntdata, han dles% hObject han dle to edit7 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han
30、 dles and user data (see GUIDATA% Hints: get(hObject,String returns contents of edit7 as text% str2double(get(hObject,String returns contents of edit7 as a doublek=get(hObject,Stri ng;han dles.k=str2 nu m(k;guidata(hObject, han dles;% han dies empty - han dies not created un til after all CreateFc n
31、s callededit7_CreateFc n( hObject, eve ntdata, han dles% - Executes during object creation, after setting all properties. functionedit8_CreateFc n( hObject, eve ntdata, han dles% hObject han dle to edit8 (see GCBO% hObject han die to edit7 (see GCBO% eve ntdata reserved - to be defi ned in a future
32、versi on of MATLAB% han dles empty - han dles not created un til after all CreateFc ns called% Hint: edit con trols usually have a white backgro und on Win dows.% See ISPC and COMPUTER.if ispcset(hObject,Backgro un dColor,white;elseset(hObject,Backgro un dColor,get(O,defaultUico ntrolBackgro undColo
33、r;endfunction edit8_Callback(hObject, eventdata, handles% hObject han dle to edit8 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATA% Hints: get(hObject,String returns contents of edit8 as text% str2double(get(
34、hObject,String returns contents of edit8 as a double% - Executes during object creation, after setting all properties. function% hObject han dle to edit9 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB %han dies empty - han dies not created un til after all CreateFc ns
35、 called% Hint: edit con trols usually have a white backgro und on Win dows.% See ISPC and COMPUTER.if ispcset(hObject,Backgro un dColor,white;elseset(hObject,Backgro un dColor,get(O,defaultUico ntrolBackgro undColor;endfunction edit9_Callback(hObject, eventdata, handles% hObject han dle to edit9 (se
36、e GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATA% Hints: get(hObject,String returns contents of edit9 as text% str2double(get(hObject,String returns contents of edit9 as a double% - Executes during object creatio
37、n, after setting all properties. functionedit9_CreateFc n( hObject, eve ntdata, han dles% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dies empty - han dies not created un til after all CreateFc ns called% han dles empty - han dles not created un til after all CreateFc ns
38、 called% Hint: edit con trols usually have a white backgro und on Win dows.% See ISPC and COMPUTER.if ispcset(hObject,Backgro un dColor,white;elseset(hObject,Backgro un dColor,get(0,defaultUico ntrolBackgro undColor;endfunction edit10_Callback(hObject, eventdata, handles% hObject handle to edit10 (s
39、ee GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATA% Hints: get(hObject,String returns contents of edit10 as text% str2double(get(hObject,Stri ng retur ns contents of edit10 as a double% - Executes during object cr
40、eation, after setting all properties. functionedit10_CreateFc n( hObject, eve ntdata, han dles% hObject handle to edit10 (see GCBO% han dies empty - han dies not created un til after all CreateFc ns called% han dles empty - han dles not created un til after all CreateFc ns called% eve ntdata reserve
41、d - to be defi ned in a future versi on of MATLAB% han dles empty - han dles not created un til after all CreateFc ns called% Hint: edit con trols usually have a white backgro und on Win dows.% Hint: edit con trols usually have a white backgro und on Win dows.% See ISPC and COMPUTER.if ispcset(hObje
42、ct,Backgro un dColor,white;elseset(hObject,Backgro un dColor,get(0,defaultUico ntrolBackgro undColor;endfunction edit11_Callback(hObject, eventdata, handles% hObject han dle to edit11 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and
43、 user data (see GUIDATA% Hin ts: get(hObject,Stri ng retur ns contents of edit11 as text% str2double(get(hObject,Stri ng retur ns contents of edit11 as a double% - Executes during object creation, after setting all properties. functionedit11_CreateFc n( hObject, eve ntdata, han dles% hObject han dle
44、 to edit11 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% Hint: edit con trols usually have a white backgro und on Win dows.% See ISPC and COMPUTER.% See ISPC and COMPUTER.if ispcset(hObject,Backgro un dColor,white;elseset(hObject,Backgro un dColor,get(0,defaultUico
45、ntrolBackgro undColor;endfunction edit12_Callback(hObject, eventdata, handles% hObject han dle to edit12 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATA% Hints: get(hObject,String returns contents of edit12 a
46、s text% str2double(get(hObject,Stri ng retur ns contents of edit12 as a double% - Executes during object creation, after setting all properties. functionedit12_CreateFc n( hObject, eve ntdata, han dles% hObject han dle to edit12 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of
47、 MATLAB% han dles empty - han dles not created un til after all CreateFc ns calledif ispc set(hObject,Backgro un dColor,white;elseset(hObject,Backgro un dColor,get(0,defaultUico ntrolBackgro undColor;endfunction edit13_Callback(hObject, eventdata, handles% hObject han dle to edit13 (see GCBO% eve nt
48、data reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATA% Hints: get(hObject,String returns contents of edit13 as text% str2double(get(hObject,Stri ng retur ns contents of edit13 as a double% - Executes during object creation, after s
49、etting all properties. functionedit13_CreateFc n( hObject, eve ntdata, han dles% hObject han dle to edit13 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles empty - han dles not created un til after all CreateFc ns called% Hint: edit con trols usually have a wh
50、ite backgro und on Win dows.% See ISPC and COMPUTER.if ispcif ispcset(hObject,Backgro un dColor,white;set(hObject,Backgro un dColor,white;elseset(hObject,Backgro un dColor,get(0,defaultUico ntrolBackgro un dColor;endfunction edit14_Callback(hObject, eventdata, handles% hObject han dle to edit14 (see
51、 GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATA% Hints: get(hObject,String returns contents of edit14 as text% str2double(get(hObject,Stri ng retur ns contents of edit14 as a double% - Executes during object crea
52、tion, after setting all properties. functionedit14_CreateFcn(hObject, eventdata, handles% hObject han dle to edit14 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles empty - han dles not created un til after all CreateFc ns called% Hint: edit con trols usually
53、have a white backgro und on Win dows.% See ISPC and COMPUTER.else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor;endset(hObject,Backgro un dColor,white;elsefunction edit15_Callback(hObject, eventdata, handles% hObject han dle to edit15 (see GCBO% eve ntdata reserved - to be defi n
54、ed in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATA% Hints: get(hObject,String returns contents of edit15 as text% str2double(get(hObject,Stri ng retur ns contents of edit15 as a double% - Executes during object creation, after setting all properties. funct
55、ionedit15_CreateFc n( hObject, eve ntdata, han dles% hObject han dle to edit15 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles empty - han dles not created un til after all CreateFc ns called% Hint: edit con trols usually have a white backgro und on Win dows.
56、% See ISPC and COMPUTER.if ispcWcp1= nu m2str(Wcp1;set(ha ndles.textGm1,stri ng,Gm1;set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor;end% - Executes during object creation, after setting all properties. functiontext30_CreateFc n( hObject, eve ntdata, han dles% hObject han dle to tex
57、t30 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles empty - han dles not created un til after all CreateFc ns called% - Executes on butt on press in pushbutt on3.function pushbutt on 3_Callback(hObject, eve ntdata, han dles% hObject handle to pushbutt on3 (se
58、e GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATAG=tf(c onv (ha ndles .nu m,ha ndles.f nu m,c onv (ha ndles.de n,ha ndles.fden;Gm1,Pm1,Wcg1,Wcp1=margi n(G;Gm 仁 nu m2str(Gm1;Pm 仁 n um2str(Pm1;Wcg1= nu m2str(Wcg1;se
59、t(ha ndles.textPm2,stri ng,Pm2;set(ha ndles.textWcg2,stri ng,Wcg2;set(ha ndles.textPm1,stri ng,Pm1;set(ha ndles.textWcg1,stri ng,Wcg1;set(ha ndles.textWcp1,stri ng,Wcp1;% - Executes on butt on press in pushbutt on4.function pushbutt on4 _Callback(hObject, eve ntdata, han dles% hObject handle to push
60、butt on4 (see GCBO% eve ntdata reserved - to be defi ned in a future versi on of MATLAB% han dles structure with han dles and user data (see GUIDATA a=handles .nu mh;b=ha ndles.de nh;G=tf(a,b;Gm2,Pm2,Wcg2,Wcp2=margi n(G;Gm2=nu m2str(Gm2;Pm2=num2str(Pm2;Wcg2=nu m2str(Wcg2;Wcp2=nu m2str(Wcp2;set(ha ndles.
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年志遠小學考試題及答案
- 2025年河北pcr考試題及答案2022
- 2025年單招各科模擬試題及答案
- 2025年工程數(shù)學段考試題及答案
- 2025年遼寧省理綜合試題及答案
- 2025年長方形測試題及答案
- 考驗大家眼力測試題及答案
- 2025年文德英語面試試題及答案
- 2025年拆遷專員考試試題及答案
- 2025年眼鏡美學題考試題及答案
- T-ZJASE 024-2023 呼吸閥定期校驗規(guī)則
- 新生兒藥物過敏
- 工作場所有害因素職業(yè)接觸限值-第2部分-物理因素
- 2024年度醫(yī)院醫(yī)學檢驗學專業(yè)進修回顧課件
- 《手腕上的菩提子》課件
- 營銷管理學菲利普科特勒
- 危重患者的病情觀察課件
- 智慧城市新篇章2024年智慧城市發(fā)展機遇展望
- 供應商QSA-QPA評鑒表
- 管理學(馬工程版)課后思考與練習解答(課后習題答案)
- 貴州教育大講堂《科技教育之美“中國天眼”的前世今生》觀后感11篇
評論
0/150
提交評論