MathGroup Archive 1998

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

Search the Archive

Re: Testing Lists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15090] Re: [mg15043] Testing Lists
  • From: BobHanlon at aol.com
  • Date: Thu, 10 Dec 1998 03:13:19 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

To create a compound function (substitute your own function
definitions):

f[x_] := Sqrt[x]
g[L_, B_, CB_] := L*B*CB
ship[L_, B_, CB_] := f[g[L, B, CB]]

ship[L, B, CB]

Sqrt[B*CB*L]

data = Table[{L, B, CB, ship[L, B, CB]}, {L, 181., 183., 1.}, 
	{B, 28.1, 28.5, 0.2}, {CB, 0.84, 0.86, 0.01}];

To test the list for an inequality, say 65.9 < ship < 66.1

qualify = Select[Flatten[data, 2], 65.9 < Last[#] < 66.1&]

{{181.,28.3,0.85,65.9845},{182.,28.1,0.85,65.9323},{182.,28.5,0.84,66.0082},{
    183.,28.3,0.84,65.9566}}

Bob Hanlon


  • Prev by Date: Re: help
  • Next by Date: Re: TableHeadings
  • Previous by thread: Testing Lists
  • Next by thread: MathLink: DLLMAIN error:linking with Borland C++ Builder 3