How I can Plots this function

how can write the code of this function

Antworten (2)

Yasasvi Harish kumar
Yasasvi Harish kumar am 16 Feb. 2019

0 Stimmen

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 am 16 Feb. 2019

0 Stimmen

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

Diese Frage ist geschlossen.

Gefragt:

am 16 Feb. 2019

Geschlossen:

am 20 Aug. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by