Error with plotting a function
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ethan Anderson
am 10 Feb. 2021
Beantwortet: Chad Greene
am 10 Feb. 2021
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
0 Kommentare
Akzeptierte Antwort
madhan ravi
am 10 Feb. 2021
Bearbeitet: madhan ravi
am 10 Feb. 2021
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');
0 Kommentare
Weitere Antworten (1)
Chad Greene
am 10 Feb. 2021
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.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Whos finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!