Mathematica question

  • Mathematica
  • Thread starter peter.a
  • Start date
  • #1
21
0
I have a function of two variables

f[x_][y_]=x^2+y;

d=Take[NestList[f[-2],0,10],-2];

now i want to repeat this process by changing -2 to -1.99, then -1.98 all the way up to 0
and storing values in a table, so i can later make a plot. I cant figure out how to repeat this process.
 

Answers and Replies

  • #2
Hepth
Gold Member
448
39
data = Table[Take[NestList[f, 0, 10], -2], {i, -2, 0, 0.01}]
 
  • #3
21
0
Thts amazing! Im a bit intimidated by the fact you did in 2 seconds what i have been working on for the better part of an hour.
Thanks.
can you tell me how i can plot this stored data using ListPlot ? to see what the relationship is between x and the y values
 
  • #4
21
0
Whoops hit post 2 times!
 
  • #5
Hepth
Gold Member
448
39
Is "ListPlot[data]" not what you're looking for?

And don't be intimidated, if you start using Mathematica a lot, Tables are a MAJOR component to using it well.
 

Related Threads on Mathematica question

Replies
4
Views
717
  • Last Post
Replies
1
Views
5K
  • Last Post
Replies
10
Views
6K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
8
Views
2K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
3
Views
9K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
5
Views
6K
Replies
9
Views
2K
Top