Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: filling in an array

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55372] Re: [mg55347] filling in an array
  • From: "David Annetts" <davidannetts at aapt.net.au>
  • Date: Sun, 20 Mar 2005 04:12:15 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

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