Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Iterating over the elements of a list' topicStudent Support Forum > General > Archives > "Iterating over the elements of a list"

Next Comment >Help | Reply To Topic
Author Comment/Response
Mac
09/19/12 4:51pm

As part of a code I am writing, I am trying to take a list of elements that I already have, numerically solve an equation for 1 variable (c) with the other variable in the equation (rhs) being substituted by the ith element of a list (rhs). I want to iterate over the list and obtain a list of values for c. I found a template for doing so on the forum, but I know certain values of c vs rhs and it I know that the program is not spitting out the correct numbers. I am a newbie. Can some look at this code and tell me what I am doing wrong?

Code:

rhs = {.0983367, .0929156, .0874946}
Table[NSolve[.5*Log10[c] + .0983367*c == rhs[[i]], c], {i, 1, 3}]

URL: ,

Subject (listing for 'Iterating over the elements of a list')
Author Date Posted
Iterating over the elements of a list Mac 09/19/12 4:51pm
Re: Iterating over the elements of a list Bill Simpson 09/21/12 1:29pm
Re: Iterating over the elements of a list yehuda 09/21/12 3:07pm
Re: Re: Iterating over the elements of a list mac 09/22/12 01:50am
Next Comment >Help | Reply To Topic