From: Ozge Taskan on 18 May 2010 01:09 Hi, I have a while loop which starts with while transpose(cons_new_sum)<(0.98)*ones(1024,1) i expect that while loop check each number in the vector and if all numbers become more than 0.98 it will stop, however it doesnot do like that, there are still some rows that do not satisfy the condition but the while loop is terminated. Is there any possibility to check each row in the vector whether numbers are greater than or equal to 0.98 by not using if since i need a loop? thank you very much in advance. Ozge
From: Walter Roberson on 18 May 2010 01:13 Ozge Taskan wrote: > I have a while loop which starts with > > while transpose(cons_new_sum)<(0.98)*ones(1024,1) > > i expect that while loop check each number in the vector and if all > numbers become more than 0.98 it will stop, however it doesnot do like > that, there are still some rows that do not satisfy the condition but > the while loop is terminated. Is there any possibility to check each row > in the vector whether numbers are greater than or equal to 0.98 by not > using if since i need a loop? while any(cons_new_sum(:) < 0.98) What you currently have is the same as while all(cons_new_sum(:) < 0.98)
|
Pages: 1 Prev: Counting stress cycles in fatigue analysis Next: help with my program |