function of the following

2 ビュー (過去 30 日間)
ivko ivkovic
ivko ivkovic 2022 年 2 月 20 日
編集済み: ivko ivkovic 2022 年 3 月 1 日
function:
time constants :

採用された回答

Image Analyst
Image Analyst 2022 年 2 月 20 日
Try this:
tau = [1, 0.5, 0.1];
for k = 1 : length(tau)
t = linspace(0, 5 * tau(k), 1000);
f = exp(-t / tau(k));
subplot(3, 1, k);
plot(t, f, 'b-', 'LineWidth', 2);
caption = sprintf('Tau = %.1f', tau(k));
title(caption);
grid on;
xlabel('t');
ylabel('f');
end
  2 件のコメント
ivko ivkovic
ivko ivkovic 2022 年 2 月 20 日
thanks is it possible to edit the script so all plots should appear in the same window and be of different styles?
thanks a lot
Image Analyst
Image Analyst 2022 年 2 月 20 日
tau = [1, 0.5, 0.1];
for k = 1 : length(tau)
t = linspace(0, 5 * tau(k), 1000);
f = exp(-t / tau(k));
plot(t, f, '-', 'LineWidth', 4);
hold on;
caption = sprintf('f vs t');
title(caption, 'FontSize', 20);
grid on;
xlabel('t', 'FontSize', 20);
ylabel('f', 'FontSize', 20);
end

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFunction Creation についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by