Problem when plotting a graph after for and if else if
Show older comments
--------------------------
C = 100;
g = 20;
s = 0.5;
T = 1;
t = 0.68;
x = 0:0.1:1
if x <t
d = 32/(1.-x*0.2)
else d = C*(1-g/C)^2./(2*(1.-x*g/C))+900*T*((x-1.)+sqrt((x-1).^2+12*C*(x-t)./(T*s*g*3600)))
end
plot(x,d)
-----------------------
Anyone help me. I dont understant why d(x=0)=21.64.
while: d(x=0<0.68)=32*(1-0)=32
Please explain help me why?
Thanks so much!
1 Comment
Le Duc Long
on 9 Jun 2020
Accepted Answer
More Answers (0)
Categories
Find more on Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!