Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9658
| From | Ray Koopman <koopman@sfu.ca> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Why the loop gain no result? |
| Date | 2012-04-15 07:20 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jmdssj$adc$1@smc.vnet.net> (permalink) |
| References | <jmb7v4$r2e$1@smc.vnet.net> |
On Apr 14, 12:11 am, Huafeng Cao <geotom....@gmail.com> 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 can't gain the result, Somewhere is disorder? I am confused.
No, you don't need the 'a'. But if you want to see the results
then you need to Print them:
For[i = 1, i < 5, i++, Print@Solve[i*x^2 - 2 x + 1 == 0, x]]
or put them in a Table:
Table[Solve[i*x^2 - 2 x + 1 == 0, x], {i,4}]
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
Why the loop gain no result? Huafeng Cao <geotom.cao@gmail.com> - 2012-04-14 07:11 +0000 Re: Why the loop gain no result? "Nasser M. Abbasi" <nma@12000.org> - 2012-04-15 07:16 +0000 Re: Why the loop gain no result? Ray Koopman <koopman@sfu.ca> - 2012-04-15 07:20 +0000
csiph-web