MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: decrementing problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg72315] Re: [mg72293] decrementing problem
  • From: János <janos.lobb at yale.edu>
  • Date: Tue, 26 Dec 2006 05:18:26 -0500 (EST)
  • References: <200612181156.GAA02194@smc.vnet.net>

On Dec 18, 2006, at 6:56 AM, jltrahan at mail.usf.edu wrote:

> Hi,
> I am having a really difficult time with decrementing values in my For
> loop. I have tried i--, --i, i-=1, i=i-1, and nothing is working.  
> The loop
> is as follows:
> For[i=n-1, i<=1, i--, summ=0;
>    For[j=i+1, j<=n, j++, summ=summ + U[[i,j]]*X[[j]]]
> ]
> When I try to print i or j, nothing shows up.
> Can anyone please help?
>
> Thank you in advance,
> Jamie

My newbie thinking is that your test in the first For loop is  
evaluating to False right away.

  i<=1

In the first step i is 4.  The question is if 4 is less than or equal  
to 1.  That is False right away, so that loop ends and does not enter  
into the second loop at all.

With the best,

János


  • Prev by Date: Re: decrementing problem
  • Next by Date: Re: decrementing problem
  • Previous by thread: decrementing problem
  • Next by thread: Re: decrementing problem