MathGroup Archive 2001

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

Search the Archive

RE: array generated

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

Julian,

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 earthlink.net
http://home.earthlink.net/~djmp/


> From: Julian Sweet [mailto:jsweet at engineering.ucsb.edu]
To: mathgroup at smc.vnet.net
>
> 	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 engineering.ucsb.edu
>



  • 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