RE: ListConvolve?
- To: mathgroup at smc.vnet.net
- Subject: [mg42453] RE: [mg42437] ListConvolve?
- From: "David Park" <djmp at earthlink.net>
- Date: Wed, 9 Jul 2003 08:24:27 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Guillermo, It took me a long time to realize that if one wants to, in general, combine the elements of two equal length lists the command to use is Inner. days = {t1, t2, t3}; retention = {f[b0, c0, t], f[ b1, c1, t], f[b2, c2, t]}; Inner[(#1 /. t -> #2) &, retention, days, List] {f[b0, c0, t1], f[b1, c1, t2], f[b2, c2, t3]} or Inner[Join[Take[#1, 2], f[#2]] &, retention, days, List] {f[b0, c0, t1], f[b1, c1, t2], f[b2, c2, t3]} But I'm not certain if this is the most efficient solution. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: guillerm at usal.es [mailto:guillerm at usal.es] To: mathgroup at smc.vnet.net Dear friend: I has two lists: days = {t1, t2, t3}; retention = {f[b0, c0, t], f[ b1, c1, t], f[b2, c2, t]}; I wish obtain this output: {f[b0, c0, t1], f[b0, c0, t2] + f[b1, c1, t1] , f[b0, c0, t3] + f[b1, c1, t2] + f[b2, c2, t1] } // TableForm I have obtain a solution but it not efficient and my lists are alredy large (here are examples). Any help? Thanks Guillermo --------------------------------------------- This message was sent using Endymion MailMan. http://www.endymion.com/products/mailman/