Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9659 > unrolled thread

Re: Why the loop gain no result?

Started byBill Rowe <readnews@sbcglobal.net>
First post2012-04-15 07:21 +0000
Last post2012-04-15 07:21 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Why the loop gain no result? Bill Rowe <readnews@sbcglobal.net> - 2012-04-15 07:21 +0000

#9659 — Re: Why the loop gain no result?

FromBill Rowe <readnews@sbcglobal.net>
Date2012-04-15 07:21 +0000
SubjectRe: Why the loop gain no result?
Message-ID<jmdsuh$adi$1@smc.vnet.net>
On 4/14/12 at 3:10 AM, geotom.cao@gmail.com (Huafeng Cao) wrote:

>I use the' For' loop to solving an equation, such as : For[i = 1, i
>< 5, i++, a = i; Solve[a*x^2 - 2 x + 1 == 0, x]].The
>'a' in the body must be updated in every loop with the 'i'. But i
>cann' t gain the result,Somewhere is disorder? I am confused.

 From the documentation for For

Unless an explicit Return is used, the value returned by For is Null

And that is why your code doesn't display any result. Instead of
using For, use Table, i.e.

Table[Solve[a*x^2 - 2 x + 1 == 0, x], {a, 5}]

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web