matlab GUI配置传递函数和控制系统设计

1、内容简介


43-可以交流、咨询、答疑

涉及到传递函数导入、零极点展示等

2、内容说明

% --- Executes on button press in operation.
function operation_Callback(hObject, eventdata, handles)
% hObject    handle to operation (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
val=get(handles.popupmenu2, 'value');
switch val
case 1
    getTransfer(handles);
case 2
    close(gcf)
    ComputationOfZeros('Visible','on');
case 3
    close(gcf)
    DemonstrationofZeros('Visible','on');    
end

function getTransfer(handles)
a=str2num(get(handles.mA,'string'));
b=str2num(get(handles.mB,'string'));
c=str2num(get(handles.mC,'string'));
d=str2num(get(handles.mD,'string'));
setappdata(0,'A',a)
setappdata(0,'B',b)
setappdata(0,'C',c)
setappdata(0,'D',d)
G=ss(a,b,c,d);  %创建系统模型
sys=tf(G);       %直接获取传递函数矩阵
[~,input]=size(b);
[output,~]=size(d);
str=['all transfer function (format:num/den )' 10];
k=1;
for i=1:input
    for j=1:output
       str_temp1=[['transfer function:' 'input' num2str(i) ' ' 'to' ' ' 'output' num2str(j)], 10];
       num_temp=['num' num2str(k) '=[' num2str(sys(j,i).num{1,1}),']'];
       den_temp=['den' num2str(k) '=[' num2str(sys(j,i).den{1,1}),']'];
       str_temp2=[[num_temp ',  ' den_temp], 10]; %当次循环需要输出的字符串
       str=[str,str_temp1,str_temp2];  %连接
       k=k+1;
    end
end
set(handles.edit15,'String',str);

% --- Executes on selection change in popupmenu2.

3、仿真分析

4、参考论文

相关推荐

  1. 课时90:流程控制_函数进阶_数组传递

    2024-02-03 06:36:03       36 阅读
  2. 时钟系统控制

    2024-02-03 06:36:03       25 阅读
  3. 飞行控制系统软件设计

    2024-02-03 06:36:03       57 阅读
  4. 函数作为参数传递匿名函数(lambda)

    2024-02-03 06:36:03       48 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-03 06:36:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-03 06:36:03       101 阅读
  3. 在Django里面运行非项目文件

    2024-02-03 06:36:03       82 阅读
  4. Python语言-面向对象

    2024-02-03 06:36:03       91 阅读

热门阅读

  1. 【MQ04】消息持久化与确认机制

    2024-02-03 06:36:03       45 阅读
  2. MacOS安装dmg提示已文件已损坏的解决方法

    2024-02-03 06:36:03       76 阅读
  3. ResizeObserver视图观察器

    2024-02-03 06:36:03       58 阅读
  4. 部署私有知识库项目FastGPT

    2024-02-03 06:36:03       44 阅读
  5. Mybatis-Plus

    2024-02-03 06:36:03       54 阅读
  6. Redis是单线程还是多线程?

    2024-02-03 06:36:03       48 阅读
  7. Redis实现登录的优化

    2024-02-03 06:36:03       50 阅读