The following exercises are meant to help you
test and develop your understanding of NetLogo
as a programming language.
Function Plotting
To make a line chart of a univariate function,
we need a function and collection of points from its domain.
- Create the integer interval [0..100].
(How many points is that?)
- Scale your points so that they lie in the real interval [0, 1].
- Treat your new points as the domain of the function
x↦x*x.
Produce the corresponding list of function values.
- Produce a list of pairs (x, f(x)) for this function.
- Make a line chart of this list of pairs.
Hints:
Do not look at these hints unless you need to!
If you need the hints, you need to review the concepts.
- Use n-values.
- Use map.
- Use map.
- Use map with two arguments. (Read the documentation carefully.)
- Use foreach, plotxy, first, and last.