フィルターのクリア

How to increase the "linewidth" of given graphs?

3 ビュー (過去 30 日間)
Sadiq
Sadiq 2023 年 4 月 29 日
コメント済み: Sadiq 2023 年 4 月 30 日
I want to increase the linewidth of the following two graphs? But how? The required mat file is hereby attached and the code is given below:
clear;clc;
s=tf('s');
G=(61.73*s^2+2.112e4)/(s^4+52.42*s^3+967.1*s^2+1.793e4*s);
%%%%%%%%%%%%%%
% Contrioller
%%%%%%%%%%%%%%
load PIDGains.mat
[one1 ind]=sort(one,'descend');
[fitness,ind1]=min(one1);
two1=two(ind1,:);
Kp=two1(1);
Ki=two1(2);
Kd=two1(3);
Gc=Kp+Ki/s+Kd*s;
%%%%%%%%%%%%%%%
% Feedback TF
%%%%%%%%%%%%%%
H=1;
%%%%%%%%%%%%%%
% Closed Loop TF
%%%%%%%%%%%%%%
T=feedback(Gc*G*H,1);
%%%%%%%%%%%%%%%%%%
% Step Response of open loop and closed loops
%%%%%%%%%%%%%%%%%%
subplot(2,1,1)
step(G)
subplot(2,1,2)
step(T)
G=stepinfo(G)
G = struct with fields:
RiseTime: NaN TransientTime: NaN SettlingTime: NaN SettlingMin: NaN SettlingMax: NaN Overshoot: NaN Undershoot: NaN Peak: Inf PeakTime: Inf
T=stepinfo(T)
T = struct with fields:
RiseTime: 7.1553e-05 TransientTime: 1.2930e-04 SettlingTime: 1.2930e-04 SettlingMin: 0.9030 SettlingMax: 0.9977 Overshoot: 0 Undershoot: 0 Peak: 0.9977 PeakTime: 2.3684e-04

採用された回答

Walter Roberson
Walter Roberson 2023 年 4 月 29 日
clear;clc;
s=tf('s');
G=(61.73*s^2+2.112e4)/(s^4+52.42*s^3+967.1*s^2+1.793e4*s);
%%%%%%%%%%%%%%
% Contrioller
%%%%%%%%%%%%%%
load PIDGains.mat
[one1 ind]=sort(one,'descend');
[fitness,ind1]=min(one1);
two1=two(ind1,:);
Kp=two1(1);
Ki=two1(2);
Kd=two1(3);
Gc=Kp+Ki/s+Kd*s;
%%%%%%%%%%%%%%%
% Feedback TF
%%%%%%%%%%%%%%
H=1;
%%%%%%%%%%%%%%
% Closed Loop TF
%%%%%%%%%%%%%%
T=feedback(Gc*G*H,1);
%%%%%%%%%%%%%%%%%%
% Step Response of open loop and closed loops
%%%%%%%%%%%%%%%%%%
ax1 = subplot(2,1,1);
step(G)
ax2 = subplot(2,1,2);
step(T)
G=stepinfo(G)
G = struct with fields:
RiseTime: NaN TransientTime: NaN SettlingTime: NaN SettlingMin: NaN SettlingMax: NaN Overshoot: NaN Undershoot: NaN Peak: Inf PeakTime: Inf
T=stepinfo(T)
T = struct with fields:
RiseTime: 7.1553e-05 TransientTime: 1.2930e-04 SettlingTime: 1.2930e-04 SettlingMin: 0.9030 SettlingMax: 0.9977 Overshoot: 0 Undershoot: 0 Peak: 0.9977 PeakTime: 2.3684e-04
set(ax1.Children(1).Children(1), 'LineWidth', 3, 'Color', 'g')
set(ax2.Children(1).Children(2), 'LineWidth', 3, 'Color', 'r')
That is, when you do step() inside a subplot, then a Group object is created, that has 2 line objects as children. The second of the two line objects is the step response. The fact that nothing showed up in green shows that (at least for this purpose) the first line object is nothing of interest.
(You do not need to set the color; I do it here just to emphasize which object has been affected (or not affected.)
  4 件のコメント
Walter Roberson
Walter Roberson 2023 年 4 月 29 日
The purpose of the code is to illustrate that the second location Children(1).Children(2) is the item to set and that Children(1).Children(1) will not work. Without this test people might tend to think that they could just set the line width of both lines Children(1).Children(:)
Sadiq
Sadiq 2023 年 4 月 30 日
Thanks a lot dear Walter Roberson for your kind response. Yes, it works now.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePID Controller Tuning についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by