MathGroup Archive 2005

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

Search the Archive

Re: Maping and Complex Addition


Pratik Desai wrote:
> I have a list of complex conjugate numbers , appearing as
> comp={a+b*I,a-b*I,c+d*I,c-d*I}
> 
> I would like to create a function ConjPlus[{}] which gives me the real 
> values obtained by adding the first two complex conjugate numbers and so 
> on. I have been able to do it using table and plus, but it would be cool 
> to just have a function you can call
> 
> Anyway, here is what I am using
> Table[Plus@@Partition[comp,2][[q]],{q,1,j}]
> 
You almost got it:

comp = {a + b*I, a - b*I, c + d*I, c - d*I};
myFunc = Plus @@@ Partition[#, 2]&;

In[3]:= myFunc[comp]
Out[3]= {2*a, 2*c}

-- 
Peter Pein
Berlin


  • Prev by Date: Re: Approximating the function from its plot
  • Next by Date: Re: Polar density plots
  • Previous by thread: Maping and Complex Addition
  • Next by thread: Re: Maping and Complex Addition