Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Dot or Inner ... but not quite

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79658] Re: [mg79622] Dot or Inner ... but not quite
  • From: Curtis Osterhoudt <cfo at lanl.gov>
  • Date: Wed, 1 Aug 2007 05:03:20 -0400 (EDT)
  • Organization: LANL
  • References: <200707311013.GAA21053@smc.vnet.net>
  • Reply-to: cfo at lanl.gov

In[55]:= l1*l2

Out[55]= {{1, 7}, {4, 36}, {15, 6}}

               :)


On Tuesday 31 July 2007 04:13:49 Diamond, Mark wrote:
> I have two equi-length lists, the first of number, the second of
> (equi-length) lists of numbers , such as
>
> l1={1,4,3};
> l2={{1,7},{1,9},{5,2}};
>
> I want to produce 1*{1,7}+4*{1,9}+3*{5,2}
>
> It looks so close to Inner that I thought I could use it in some form, but
> I have ended up using
>
> (#[[1]]*#[[2]])& /@ Transpose[{l1,l2}]
>
> Is there a better way using one of the builtin functions with which I am
> unfamiliar?
>
> Cheers,
>
> Mark Diamond



-- 
==========================================================
Curtis Osterhoudt
cfo at remove_this.lanl.and_this.gov
PGP Key ID: 0x4DCA2A10
Please avoid sending me Word or PowerPoint attachments
See http://www.gnu.org/philosophy/no-word-attachments.html
==========================================================


  • Prev by Date: Re: Double Integration involving Struve and Neumann functions
  • Next by Date: Re: Is Save As->HTML broken in 6.0?
  • Previous by thread: Re: Dot or Inner ... but not quite
  • Next by thread: Re: Dot or Inner ... but not quite