Logical condition for a while lopp exits prematureley
Show older comments
Hi, I have this while loop criteria,
while((std(PenPar(:,2),0,1) > 50 && std(PenPar(:,3),0,1) > 50 && std(PenPar(:,4),0,1) > 50) || Stopper==500)
but it stops prematurely; only one of the and terms are satisfied.
Can someone explain me why it is so? Best reagrds
5 Comments
KSSV
on 28 Oct 2016
Whats is your stopper value? It changes or fixed?
Philip Berg
on 28 Oct 2016
Edited: Philip Berg
on 28 Oct 2016
Philip Berg
on 28 Oct 2016
KSSV
on 28 Oct 2016
As stopper is less then 500. This statement counts to 0. If any std out of three is not satisfied then loop will surely stops. You have to check your std.
Philip Berg
on 28 Oct 2016
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements 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!