help-octave
[Top][All Lists]
Advanced

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

Re: imbricated loops


From: Doug Stewart
Subject: Re: imbricated loops
Date: Mon, 8 Nov 2010 07:46:43 -0500

On Fri, Nov 5, 2010 at 3:37 PM, Judd Storrs <address@hidden> wrote:
> On Fri, Nov 5, 2010 at 3:25 PM, William Krekeler
> <address@hidden> wrote:
>> The error is likely in how the code interprets the statement as written. for 
>> (j=1:i-1) is likely interpreted as for (j=1:i) -1. The -1 is extra. I've run 
>> into this problem in Matlab before. Add explicit () around your arguments 
>> and see if it works.
>
> Explicit parentheses shouldn't be necessary since ":" has lower
> operator precedence than "-".  In other words, "j=1:i-1" is defined to
> be identical to "1:(i-1)". See:
>
> http://www.gnu.org/software/octave/doc/interpreter/Operator-Precedence.html#Operator-Precedence
>
>
> --judd
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>

Hi

thanks a lot for taking the time to answer me.
in fact, I was copy/pasting the code to the prompt instead to run the
.m file directly (thinking that it would help debugging).
But in fact the .m file works fine. It is the copy/paste to the prompt
that does not.

Best regards
Delphine.



OK
This has been solved off line.
Doug Stewart



reply via email to

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