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、参考论文

相关推荐
程高兴2 天前
遗传算法求解冷链路径优化问题matlab代码
开发语言·人工智能·matlab
念念01073 天前
基于MATLAB多智能体强化学习的出租车资源配置优化系统设计与实现
大数据·人工智能·matlab
fengfuyao9853 天前
基于MATLAB的GUI实现人脸检测、眼睛检测以及LBP直方图显示
开发语言·计算机视觉·matlab
一株月见草哇3 天前
Matlab(5)进阶绘图
matlab
项目申报小狂人3 天前
算法应用上新!自适应更新策略差分进化算法求解球形多飞行器路径规划问题,附完整MATLAB代码
开发语言·算法·matlab
躺平都躺不明白3 天前
数学建模-评价类问题-优劣解距离法(TOPSIS)
数学建模·matlab
壹Y.6 天前
MATLAB 绘图速查笔记
笔记·matlab
Evand J6 天前
【MATLAB例程】滑动窗口均值滤波、中值滤波、最小值/最大值滤波对比。附代码下载链接
开发语言·matlab·均值算法
一株月见草哇7 天前
Matlab(4)
人工智能·算法·matlab
2401_823868227 天前
织构表面MATLAB仿真
人工智能·机器学习·matlab·信号处理