I understand the concept behind the error, but not so much the reason as it applies to the code. This is a homework problem that I was given.
If there are other issues with this code, I would really appreciate any and all explanations!
t = (0:.2:50);V = zeros(length(t));for i=1:length(t) if 0 <= t(i) <= 8 V(i) = 10*t.^2-5*t; elseif 8 < t(i) <= 16 V(i) = 624-5*t; elseif 16 < t(i) <= 26 V(i) = 36*t+12*(t-16)^2; else t(i) > 26; V(i) = 2136*exp(1)^(-0.1*(t-26)); endendplot(t,V)
Best Answer