How I can Plots this function

how can write the code of this function

回答 (2 件)

Yasasvi Harish kumar
Yasasvi Harish kumar 2019 年 2 月 16 日

0 投票

Hey,
This should help you.
function x = question(t)
if t >=0
x = 3*exp(-2*t);
else
x = 0;
end
end
Regards
Star Strider
Star Strider 2019 年 2 月 16 日

0 投票

Another approach:
x = @(t) 3*exp(-2*t) .* (t >= 0);
t = linspace(-10,10);
figure
plot(t, x(t))

この質問は閉じられています。

質問済み:

2019 年 2 月 16 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by