Plotting a function where the x-axis is also a function
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Eli Wolkenstein
am 17 Feb. 2023
Bearbeitet: Voss
am 17 Feb. 2023
I want to plot a power vs velocity graph for this function P(t)=229500*v(1+0.2647*v) and v is also a function: v(t)=6.6524*(exp(0.0183993*t)-1). I wrote this code but it doesn't work. ANy ideas about why it's wrong?
t=0:1:50;
v=6.6524*(exp(0.0183993*t)-1);
p=2295000*v(1+0.2647*v);
plot(v,p)
title('Power vs Velocity')
xlabel('Velocity (m/s)')
ylabel('Power (W)')
0 Kommentare
Akzeptierte Antwort
Voss
am 17 Feb. 2023
t=0:1:50;
v=6.6524*(exp(0.0183993*t)-1);
% p=2295000*v(1+0.2647*v);
% ^^ missing operator (.*)
p=2295000*v.*(1+0.2647*v);
plot(v,p)
title('Power vs Velocity')
xlabel('Velocity (m/s)')
ylabel('Power (W)')
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots 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!