MathGroup Archive 2005

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

Search the Archive

Re: filling in an array


Hi Andrea,

> How can I input values into an array most efficiently?  I 
> tried the code below, but it doesn't work.  The kernel starts 
> working through the loop and never gets out.
> Array[b, 10];
> For[i = 1, i = 10, b[i] = i/10]

You could try

Range[10]/10 which produces a list.

Or

Table[i/10, {1, 10}]

Regards,

Dave.


  • Prev by Date: findroot
  • Next by Date: Do loop is faulty
  • Previous by thread: Re: filling in an array
  • Next by thread: Re: filling in an array