What is wrong with this code?
显示 更早的评论
I'm trying to execute a set of elseif statements, but the third condition is not being recognized. Even when the value of v(i) is between vr and vco, the statement is returning the answer for the second condition.
for i=1:8760
if v(i)<vci || v(i)>vco
P(i)=0;
elseif vci<=v(i)<vr
P(i)=(0.5*1.225*18146*0.45*(v(i)^3))/10^3;
elseif vr<=v(i)<=vco
P(i)=Prated;
end
end
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!