MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: array generated

  • To: mathgroup at
  • Subject: [mg28912] RE: [mg28889] array generated
  • From: "David Park" <djmp at>
  • Date: Fri, 18 May 2001 01:13:16 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


That seems like a very reasonable request since it is a common problem. Here
is one approach. Write a routine that converts an "iterator" defined in
terms of the number of points into a normal iterator.

pointsiter[i_, min_, max_, numpoints_] := {i, min,
    max, (max - min)/(numpoints - 1)}

Table[i, pointsiter[i, 2, 15, 6] // Evaluate]
{2, 23/5, 36/5, 49/5, 62/5, 15}

Table[i, pointsiter[i, -0.235, 2.654, 5] // Evaluate]
{-0.235, 0.48725, 1.2095, 1.93175, 2.654}

I don't know how to eliminate the need for Evaluate without changing the
Attributes of Table. Also with floating point values I am not certain if
Mathematica will always get the last point.

David Park
djmp at

> From: Julian Sweet [mailto:jsweet at]
To: mathgroup at
> 	Is there a command that will allow me to specify a start and
> stop value, and the number of points i want generated?
> Table[i,{i,min,max,di}] requires that i specify the interval, di, and
> surmise the resultant number of points from that interval.
> e-mail response appreciated: jsweet at

  • Prev by Date: Re: ListPlot vs ListPlot3D
  • Next by Date: Re: Q: Recursion on a list
  • Previous by thread: Re: array generated
  • Next by thread: Q: Recursion on a list