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!