Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9659 > unrolled thread
| Started by | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| First post | 2012-04-15 07:21 +0000 |
| Last post | 2012-04-15 07:21 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Why the loop gain no result? Bill Rowe <readnews@sbcglobal.net> - 2012-04-15 07:21 +0000
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Date | 2012-04-15 07:21 +0000 |
| Subject | Re: 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}]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web