help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: while/for statement — what's wrong in a code?


From: alhaim
Subject: Re: while/for statement — what's wrong in a code?
Date: Sat, 30 Apr 2011 03:21:14 -0700 (PDT)

I should have mention it before -- p is set to 0.01 at the beginning.

The whole code goes like this:


sens = 0.1;     
p = 0.1;        

%K = 1; 

%ceil(log_2 K)+ 1/[1-(1-p)^K]
for K= 1:10
        while ( p < 1 )
                ceil(log2(K))  +  1/(1-(1-p)^K) 
                p = p + sens;
                K
        endwhile;
 endfor
 
 K--
View this message in context: 
http://octave.1599824.n4.nabble.com/while-for-statement-what-s-wrong-in-a-code-tp3485616p3485642.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]