how to plot v-t graph for v=v0(e^-kt)?

답변 (2개)

Davide Masiello
Davide Masiello 2022년 3월 10일

0 개 추천

Try this
clear,clc
v0 = 1;
k = 1;
t = linspace(0,10,100);
v = v0*exp(-k*t);
figure
plot(t,v)
Sam Chak
Sam Chak 2022년 3월 10일
편집: Sam Chak 2022년 3월 10일

0 개 추천

The method posted by @Davide Masiello is proper. Alternatively, if you want a quick plot to view, then you can do this:
v0 = 3; % initial value
k = 2; % inverse of time constant (tau = 0.5), that's why it converges at 5*tau = 2.5 sec
fplot(@(t) v0*exp(-k*t), [0 5]);

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

질문:

2022년 3월 10일

편집:

2022년 3월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by