help-octave
[Top][All Lists]
Advanced

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

Re: ranges (was Numerical issues with sin()/cos() )


From: Ian McCallion
Subject: Re: ranges (was Numerical issues with sin()/cos() )
Date: Fri, 30 Mar 2018 16:39:48 +0000

On Fri, 30 Mar 2018, 17:20 Francesco Potortì, <address@hidden> wrote:

>>   for ct =1:inf
>
>1:inf is not valid syntax.  Ranges need finite limits and are expanded
>to an array as soon as they used, as far as I can tell.

Oh, what you want can be done like this:

while true
      if condition break;
endwhile

Thanks, though for equivalence I would need:

   ct=0;
   while true
       ct++;
       if condition; break
   endwhile

Which makes my version more compact familiar and readable.

The syntax of C++, java and no doubt many other languages allows use of the for loop with no end test. That Octave should join the crowd is all I was thinking.

Cheers... Ian

reply via email to

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