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 天前
基于BiGRU-Attention的轴承剩余寿命预测(MATLAB实现):从振动信号到RUL曲线的完整闭环
数据结构·算法·matlab·轴承剩余寿命预测·振动信号·bigru-attention
Evand J2 天前
【MATLAB代码,车联网8】MPC网联车辆节能跟驰控制:速度跟踪、间距约束与能耗优化。MATLAB完整代码订阅专栏后可直接查看
matlab·代码·车联网·mpc·车辆·网联·网联技术
我找到地球的支点啦3 天前
Matlab系列(009) 一CRC循环冗余校验详解
开发语言·数据结构·算法·matlab·信息与通信
吃好睡好便好6 天前
查找函数的使用
学习·算法·matlab·生活·查找函数
chhttty6 天前
Design Verifier检查:整型数溢出检查与修复
matlab·simulink
吃好睡好便好6 天前
判断函数的使用
学习·算法·matlab·生活·判断函数
hu9245195596 天前
Matlab保护源代码—P文件和exe文件详细解析
开发语言·matlab
史上最甜的躯6 天前
控制系统——基础、导论;以直流电机控制系统为例详解微分方程模型、拉普拉斯变换、传递函数模型的理论、推导及仿真
matlab·simulink·传递函数·控制系统·拉普拉斯·电机模型
lingchen19067 天前
用MATLAB r2010b和r2016b求解微分方程组
开发语言·算法·matlab
可编程芯片开发7 天前
基于李雅普诺夫算法的四旋翼无人机姿态跟踪控制系统simulink建模与仿真
matlab·无人机·制造·四旋翼无人机·李雅普诺夫·姿态跟踪控制