版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、function num,den=cqjz(G,kc,yPmG=tf(G;mag,pha,w=bode(G*kc;Mag=20*log10(mag;Gm,Pm,Wcg,Wcp=margin(G*kc;%phi=(yPm-getfield(Pm,'Wcg'*pi/180;phi=(yPm+5-Pm*pi/180;alpha=(1+sin(phi/(1-sin(phi;Mn=-10*log10(alpha;Wcgn=spline(Mag,w,Mn;T=1/(Wcgn*sqrt(alpha;Tz=alpha*T;num=Tz,1;den=T,1;function varargout
2、= keshe(varargin% KESHE, by itself, creates a new KESHE or raises the existing% singleton*.% H = KESHE returns the handle to a new KESHE or the handle to% the existing singleton*.% KESHE('CALLBACK',hObject,eventData,handles,. calls the local % function named CALLBACK in KESHE.M with the give
3、n input arguments. % KESHE('Property','Value',. creates a new KESHE or raises the % existing singleton*. Starting from the left, property value pairs are% applied to the GUI before keshe_OpeningFunction gets called. An % unrecognized property name or invalid value makes property appl
4、ication% stop. All inputs are passed to keshe_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% Copyright 2002-2003 The MathWorks, Inc.% Edit the above text to modify the re
5、sponse to help keshe% Last Modified by GUIDE v2.5 30-Dec-2009 18:31:42% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, .'gui_Singleton', gui_Singleton, .'gui_OpeningFcn', keshe_OpeningFcn, .'gui_OutputFcn', keshe_Out
6、putFcn, .'gui_LayoutFcn', , .'gui_Callback', ;if nargin && ischar(varargin1gui_State.gui_Callback = str2func(varargin1;endif nargoutvarargout1:nargout = gui_mainfcn(gui_State, varargin:; elsegui_mainfcn(gui_State, varargin:;end% End initialization code - DO NOT EDIT% - Execut
7、es just before keshe is made visible.function keshe_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 GUIDA
8、TA% varargin command line arguments to keshe (see VARARGIN% Choose default command line output for keshehandles.output = hObject;% Update handles structureguidata(hObject, handles;% UIWAIT makes keshe wait for user response (see UIRESUME% uiwait(handles.figure1;% - Outputs from this function are ret
9、urned to the command line. function varargout = keshe_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 G
10、UIDATA% Get default command line output from handles structurevarargout1 = handles.output;% - 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%
11、handles structure with handles and user data (see GUIDATAfigure(2bode(handles.numh,handles.denh;xlabel('Frequency rad/s','fontsize',10;ylabel('Phase deg Gain dB','fontsize',10;title('Bode Diagram of original signal'guidata(hObject,handles;% - Executes on butto
12、n 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 GUIDATAfigure(1bode(conv(handles.num,handles.fnum,conv(handle
13、s.den,handles.fden; xlabel('Frequency rad/s','fontsize',10;ylabel('Phase deg Gain dB','fontsize',10;title('Bode Diagram of original signal'guidata(hObject,handles;function edit1_Callback(hObject, eventdata, handles% hObject handle to edit1 (see GCBO% eventdata
14、 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_num=get(hObject,'String'ha
15、ndles.num=str2num(num;guidata(hObject, handles;% - 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 cre
16、ated until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispcset(hObject,'BackgroundColor','white'elseset(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor' ;endfunction edit2_Call
17、back(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&
18、#39; returns contents of edit2 as a% doubleden=get(hObject,'String'handles.den=str2num(den;guidata(hObject, handles;% - Executes during object creation, after setting all properties. function edit2_CreateFcn(hObject, eventdata, handles% hObject handle to edit2 (see GCBO% eventdata reserved -
19、 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 ispcset(hObject,'BackgroundColor','white'elseset(hObject,'BackgroundColor
20、',get(0,'defaultUicontrolBackgroundColor' ;endfunction edit3_Callback(hObject, eventdata, handles% hObject handle to edit3 (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,'Strin
21、g' returns contents of edit3 as text% str2double(get(hObject,'String' returns contents of edit3 as a double% - Executes during object creation, after setting all properties. function edit3_CreateFcn(hObject, eventdata, handles% hObject handle to edit3 (see GCBO% eventdata reserved - to b
22、e 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 ispcset(hObject,'BackgroundColor','white'elseset(hObject,'BackgroundColor'
23、,get(0,'defaultUicontrolBackgroundColor' ;endfunction edit4_Callback(hObject, eventdata, handles% hObject handle to edit4 (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'
24、; returns contents of edit4 as text% str2double(get(hObject,'String' returns contents of edit4 as a double% - Executes during object creation, after setting all properties. function edit4_CreateFcn(hObject, eventdata, handles% hObject handle to edit4 (see GCBO% eventdata reserved - to be def
25、ined 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 ispcset(hObject,'BackgroundColor','white'elseset(hObject,'BackgroundColor',get(
26、0,'defaultUicontrolBackgroundColor' ;endfunction edit6_Callback(hObject, eventdata, handles% hObject handle to edit6 (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' ret
27、urns contents of edit6 as text% str2double(get(hObject,'String' returns contents of edit6 as a doublepm=get(hObject,'String'handles.pm=str2num(pm;guidata(hObject, handles;% - Executes during object creation, after setting all properties. function edit6_CreateFcn(hObject, eventdata, h
28、andles% hObject handle to edit6 (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 ispcset(hObject,'Backgroun
29、dColor','white'elseset(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor' ;endfunction edit7_Callback(hObject, eventdata, handles% hObject handle to edit7 (see GCBO% eventdata reserved - to be defined in a future version of MATLAB% handles structure with ha
30、ndles 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,'String'handles.k=str2num(k;guidata(hObject, handles;% - Executes during object creation, after
31、setting all properties. function edit7_CreateFcn(hObject, eventdata, handles% hObject handle to edit7 (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 backgroun
32、d on Windows.% See ISPC and COMPUTER.if ispcset(hObject,'BackgroundColor','white'elseset(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor' ;endfunction edit8_Callback(hObject, eventdata, handles% hObject handle to edit8 (see GCBO% eventdata reserved -
33、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 edit8 as text% str2double(get(hObject,'String' returns contents of edit8 as a double% - Executes during object creation, after setti
34、ng all properties. function edit8_CreateFcn(hObject, eventdata, handles% hObject handle to edit8 (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
35、Windows.% See ISPC and COMPUTER.if ispcset(hObject,'BackgroundColor','white'elseset(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor' ;endfunction edit9_Callback(hObject, eventdata, handles% hObject handle to edit9 (see GCBO% eventdata reserved - to be
36、 defined in a future version of MATLAB% handles structure with handles 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 creation, after setting al
37、l properties. function edit9_CreateFcn(hObject, eventdata, handles% hObject handle to edit9 (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 Windo
38、ws.% See ISPC and COMPUTER.if ispcset(hObject,'BackgroundColor','white'elseset(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor' ;endfunction edit10_Callback(hObject, eventdata, handles% hObject handle to edit10 (see GCBO% eventdata reserved - to be de
39、fined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA% Hints: get(hObject,'String' returns contents of edit10 as text% str2double(get(hObject,'String' returns contents of edit10 as a double% - Executes during object creation, after setting all
40、 properties. function edit10_CreateFcn(hObject, eventdata, handles% hObject handle to edit10 (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 Wind
41、ows.% See ISPC and COMPUTER.if ispcset(hObject,'BackgroundColor','white'elseset(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor' ;endfunction edit11_Callback(hObject, eventdata, handles% hObject handle to edit11 (see GCBO% eventdata reserved - to be d
42、efined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA% Hints: get(hObject,'String' returns contents of edit11 as text% str2double(get(hObject,'String' returns contents of edit11 as a double% - Executes during object creation, after setting al
43、l properties. function edit11_CreateFcn(hObject, eventdata, handles% hObject handle to edit11 (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 Win
44、dows.% See ISPC and COMPUTER.if ispcset(hObject,'BackgroundColor','white'elseset(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor' ;endfunction edit12_Callback(hObject, eventdata, handles% hObject handle to edit12 (see GCBO% eventdata reserved - to be
45、defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA% Hints: get(hObject,'String' returns contents of edit12 as text% str2double(get(hObject,'String' returns contents of edit12 as a double% - Executes during object creation, after setting a
46、ll properties. function edit12_CreateFcn(hObject, eventdata, handles% hObject handle to edit12 (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 Wi
47、ndows.% See ISPC and COMPUTER.if ispcset(hObject,'BackgroundColor','white'elseset(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor' ;endfunction edit13_Callback(hObject, eventdata, handles% hObject handle to edit13 (see GCBO% eventdata reserved - to be
48、 defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA% Hints: get(hObject,'String' returns contents of edit13 as text% str2double(get(hObject,'String' returns contents of edit13 as a double% - Executes during object creation, after setting
49、all properties. function edit13_CreateFcn(hObject, eventdata, handles% hObject handle to edit13 (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 W
50、indows.% See ISPC and COMPUTER.if ispcset(hObject,'BackgroundColor','white'elseset(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor' ;endfunction edit14_Callback(hObject, eventdata, handles% hObject handle to edit14 (see GCBO% eventdata reserved - to b
51、e defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA% Hints: get(hObject,'String' returns contents of edit14 as text% str2double(get(hObject,'String' returns contents of edit14 as a double% - Executes during object creation, after setting
52、 all properties. function edit14_CreateFcn(hObject, eventdata, handles% hObject handle to edit14 (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
53、Windows.% See ISPC and COMPUTER.if ispcset(hObject,'BackgroundColor','white'elseset(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor' ;endfunction edit15_Callback(hObject, eventdata, handles% hObject handle to edit15 (see GCBO% eventdata reserved - to
54、be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA% Hints: get(hObject,'String' returns contents of edit15 as text% str2double(get(hObject,'String' returns contents of edit15 as a double% - Executes during object creation, after settin
55、g all properties. function edit15_CreateFcn(hObject, eventdata, handles% hObject handle to edit15 (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
56、 Windows.% See ISPC and COMPUTER.if ispcset(hObject,'BackgroundColor','white'elseset(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor' ;end% - Executes during object creation, after setting all properties. function text30_CreateFcn(hObject, eventdata,
57、handles% hObject handle to text30 (see GCBO% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% - Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles% hObject handle to
58、 pushbutton3 (see GCBO% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATAG=tf(conv(handles.num,handles.fnum,conv(handles.den,handles.fden; Gm1,Pm1,Wcg1,Wcp1=margin(G;Gm1=num2str(Gm1;Pm1=num2str(Pm1;Wcg1=num2str(Wcg1;Wcp1=num2s
59、tr(Wcp1;set(handles.textGm1,'string',Gm1;set(handles.textPm1,'string',Pm1;set(handles.textWcg1,'string',Wcg1;set(handles.textWcp1,'string',Wcp1;% - Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles% hObject handle to pus
60、hbutton4 (see GCBO% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATAa=handles.numh;b=handles.denh;G=tf(a,b;Gm2,Pm2,Wcg2,Wcp2=margin(G;Gm2=num2str(Gm2;Pm2=num2str(Pm2;Wcg2=num2str(Wcg2;Wcp2=num2str(Wcp2;set(handles.textGm2,'string',Gm2;set(handl
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026山东威海机械工程高级技工学校招聘教师5人建设考试备考试题及答案解析
- 2026年克拉玛依市企事业单位高层次、急需紧缺人才引进(363人)建设笔试参考题库及答案解析
- 2026浙江杭州市文三教育集团定山小学招聘语文老师(非事业)1人建设考试备考试题及答案解析
- 2026福建厦门市翔安区金海小学招聘非在编合同教师2人建设笔试参考题库及答案解析
- 2026北京大学生命科学学院招聘劳动合同制工作人员3人建设考试备考题库及答案解析
- 2026贵港市夏荷学校招聘建设笔试参考题库及答案解析
- 2026福建莆田市卫生健康委员会高层次及重点紧缺专业人才招聘25人建设笔试备考试题及答案解析
- 2025年安徽省淮北市法院书记员招聘笔试试题及答案解析
- 2026四川乐山市沐川县招聘城镇公益性岗位人员1人建设笔试参考题库及答案解析
- 中国葛洲坝集团建设工程有限公司2026届校园招聘建设笔试备考题库及答案解析
- 2026年CAAC无人机理论考试题库(修订版)
- 《字符编码》教学课件-2025-2026学年浙教版(新教材)小学信息科技四年级下册
- 2026春人教版(新教材)小学美术二年级下册《不息的生命》教学课件
- 2026年宁波城市职业技术学院单招职业技能测试题库及完整答案详解1套
- 2026年春湘美版(新教材)初中美术八年级下册教学计划及进度表
- 第6课 少让父母操心 第1课时 课件+视频 2025-2026学年道德与法治三年级下册统编版
- 房地产市场宏观调控下经济法律纠纷的多元化解与规则重塑
- 我国民间借贷法律困境及化解路径探究
- 华鲁恒升招聘笔试题库
- GB/Z 115-2025齿轮蜗杆副承载能力计算
- SIS安全仪表培训资料课件
评论
0/150
提交评论