I can't seem to figure out how to just plot the function y = K^(1-e^(-rt)). How can I get this to plot? Every way I seem to input the values in the plot function, it calls an error in line 6.
K = 10;
r = .1;
t = 0:1:100;
solution1 = @(t,y) K ^ (1 - (exp(-t*r)));
plot(t,(K^(1 - (exp(t*r*-1)))), '-b');
hold on

 채택된 답변

madhan ravi
madhan ravi 2021년 2월 10일
편집: madhan ravi 2021년 2월 10일

0 개 추천

K = 10;
r = .1;
t = 0:1:100;
solution1 = @(t,y) K .^ (1 - (exp(-t*r)));
plot(t,(K.^(1 - (exp(t*r*-1)))), '-b');

추가 답변 (1개)

Chad Greene
Chad Greene 2021년 2월 10일

0 개 추천

Try this:
plot(t,(K.^(1 - (exp(t.*r.*-1)))), '-b');
I put a dot (.) before the exponents and multiplication. That turns it into a dot product instead of the default cross product.

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

제품

릴리스

R2020b

태그

질문:

2021년 2월 10일

답변:

2021년 2월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by