title({['Unit Step Response of G(s) = \omega_{n}/(s^2 + 2\zeta\omega_{n}s + \omega_{n}^2)'], ...
['\zeta = ', num2str(zeta(n)), ' and \omega_n = ', num2str(omega(n))]});
ylabel('System Response');
hold on
Add values from vector to plot title
10 ビュー (過去 30 日間)
古いコメントを表示
How do I add values from zeta and omega to the plot title with commas between the values?
Current code only displays the last value in the array.
Appreciate the help
clear
s = tf('s');
zeta = input('Enter damping ratio values in a 1D array: ');
omega = input('Enter natural frequency values in a 1D array: ');
stop = input('Enter stop time: ');
figure;
hold on;
for n = 1 : length(omega)
Gs = omega(n)^2 / ((s^2) + (2*zeta(n)*omega(n)*s) + omega(n)^2);
step(Gs, stop);
end
hold off;
title({['Unit Step Response of G(s) = \omega_{n}/(s^2 + 2\zeta\omega_{n}s + \omega_{n}^2)'], ...
['\zeta = ', num2str(zeta(n)), ' and \omega_n = ', num2str(omega(n))]});
ylabel('System Response');
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Numeric Types についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!