Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10916

Re: Sum of terms --> list

From bar@ANTYSPAM.ap.krakow.pl
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Sum of terms --> list
Date 2012-07-14 05:27 +0000
Message-ID <jtqvva$ba1$1@smc.vnet.net> (permalink)
References <jtd4ec$9r3$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


Dana DeLouis <dana01@me.com> wrote:
> > LB[z_] := List @@ B[z]
> > LB[3]  (* NOT OK*)

[...]
> One needs to hold the evaluation, or perhaps just:

> B[z_]:=1/(2-z)+3/(4-z)+5/(6-z)

> LB[z_]:=(List@@B[#1]) /. #1 -> z

> LB[x]
> {1/(2-x), 3/(4-x), 5/(6-x)}

> LB[3]
> {-1, 3, 5/3}

> = = = = = = = = = =
> HTH  :>)
> Dana DeLouis
> Mac & Math 8
> = = = = = = = = = =

After help from Thomas G. i have found a simple solution
I have used 

B[z_] := 1/(2 - z) + 3/(4 - z) + 5/(6 - z);
LB[z_] = List @@ B[z] (* = instead := in function definition*)
LB[3]

It gives good solution, 

I'm not sure if this way can have bad consequences ..

Olaf

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: Sum of terms --> list Dana DeLouis <dana01@me.com> - 2012-07-08 23:17 +0000
  Re: Sum of terms --> list bar@ANTYSPAM.ap.krakow.pl - 2012-07-14 05:27 +0000

csiph-web