help-octave
[Top][All Lists]
Advanced

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

Re: Help for loop while and Operators


From: siko1056
Subject: Re: Help for loop while and Operators
Date: Fri, 18 Nov 2016 16:30:22 -0800 (PST)

Julien563 wrote
> [...]
> 
> j=nr-yc
> i=xc
> 
> k=0
> 
> i_nouveau_d=i
> i_nouveau_g=i
> j_nouveau_h=j
> j_nouveau_b=j
> 
> while ((B(i_nouveau_d,j,:) && B(i_nouveau_g,j,:)) && (B(i,j_nouveau_h,:)
> && B(i,j_nouveau_b,:)) != 1)
>       while (B(i_nouveau_d,j,:)!= B(i_nouveau_g,j,:)) && (B(i,j_nouveau_h,:)!=
> B(i,j_nouveau_b,:)) | i_nouveau_d!=nc | i_nouveau_g!=0 | j_nouveau_h!=0 |
> j_nouveau_b!=nr
>               k=k+1
>                 i_nouveau_d = i_nouveau_d+k
>                 i_nouveau_g = i_nouveau_g-k
>                 j_nouveau_h = j_nouveau_h+k
>                 j_nouveau_b = j_nouveau_b-k
> disp(i_nouveau_d)
> disp(i_nouveau_g)
> disp(j_nouveau_b)
> disp(j_nouveau_h)
> 
> [...]

Your code doesn't have any "endwhile" loop terminations? See for example
https://www.gnu.org/software/octave/doc/interpreter/The-while-Statement.html#The-while-Statement
.

Consider using semicolons ";" at the end of lines to suppress too much
output. For additional help please provide a MCVE minimal complete and
verifiable example, means initialize all variables with values I can simply
copy&paste&run to see what is going wrong.

HTH, Kai



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Help-for-loop-while-and-Operators-tp4680666p4680669.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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