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: Do loop is faulty

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55399] Re: [mg55368] Do loop is faulty
  • From: Hui Fang <fangh73 at xmu.edu.cn>
  • Date: Mon, 21 Mar 2005 03:02:05 -0500 (EST)
  • Organization: Xiamen University Photonics Center
  • References: <200503200912.EAA28772@smc.vnet.net>
  • Reply-to: fangh73 at xmu.edu.cn
  • Sender: owner-wri-mathgroup at wolfram.com

You need to specify a range for the Do loop.

Do[c[i]=NIntegrate[a[i]*x*Sin[b[i]*x],{x,0,b[i]}],{i,10}]




dumb_founded wrote:

>I define array a[i] and array b[i] of dimension 10.  Then I go through
>the following Do loop, or try to, that is.
>
>
>Array[c,10];
>Do[c[i]=NIntegrate[a[i]*x*Sin[b[i]*x],{x,0,b[i]}]
>
>I get numerous error messages saying that b[i] is not a valid limit of
>integration.
>
>This is sheer headache.  I will never try to use Mathematica for
>numerical analysis again.
>
>All your efforts on this matter are sincerely appreciated.
>
>
>
>Thanks
>
>  
>


  • Prev by Date: Restriction on the domain of Plot3D
  • Next by Date: Re: simple cipher
  • Previous by thread: Do loop is faulty
  • Next by thread: Re: Do loop is faulty