MathGroup Archive 2005

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

Search the Archive

Re: filling in an array

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55363] Re: filling in an array
  • From: "Hans Michel" <hmichel at sdc.cox.net>
  • Date: Sun, 20 Mar 2005 04:11:55 -0500 (EST)
  • References: <d1guie$sc$1@smc.vnet.net>
  • Reply-to: "Hans Michel" <hmichel at sdc.cox.net>
  • Sender: owner-wri-mathgroup at wolfram.com

df

Try

Array[b, 10];

For[i = 1, i <= 10, b[i] = i/10; i++]

Give Mathematica a chance. Yes, you can keep your programing paradigm, but 
from you previous question on Do loops you should consider other 
alternatives to list building that are purely functional. You are going to 
get frustrated with Mathematica abandon it at this rate. If your just 
playing fine; but consider the help file and consider your goal. It is 
sometimes better to ask how do I accomplish this with Mathematica as opposed 
to specific sub task. Your approach may need some tweaking.

Hans

"dumb_founded" <andreajagger_8 at hotmail.com> wrote in message 
news:d1guie$sc$1 at smc.vnet.net...
> 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]
> 


  • Prev by Date: Re: filling in an array
  • Next by Date: Re: plotting weighted graphs
  • Previous by thread: Re: filling in an array
  • Next by thread: Re: filling in an array