defining a range as a value for while loop
显示 更早的评论
hi everybody I'm trying real hard for finding a way to define a range as a value to put it in a while loop and get a result but I have failed i'm doing it like this:
FX=(5*3.1416*M);
FM=(3*3.1416*M);
F=Wt/(KV*O*M*Y*(10^(-3)));
U=linspace(FM,FX,100);
while F~=U;
do some mathematics;
FX=(5*3.1416*M);
FM=(3*3.1416*M);
U=linspace(FM,FX,100);
F=Wt/(KV*O*M*Y*(10^(-3)));
end
when i insert the values it just says matlab is busy and no result shows up. i don't which part i am doing wrong. i'll be extremely thankful if you give a help
2 个评论
You haven't really given enough information.
Is F a scalar?
U certainly isn't a scalar so you can't sensibly test:
F ~= U
in a loop. A scalar will never equal a vector and that isn't what you want to test anyway.
Are you trying to test if F is not a member of U or outside of the range it defines or something else?
ali najafi
2015-12-3
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!