MathGroup Archive 2002

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

Search the Archive

AW: elementwise vector scalar subtraction


Hello Oscar,

there is a way to automate this process.
Try:

Table[{tc15[[1]], Take[tc15, -(Length[tc15] - 1)] - n}, {n, 0.15, 0.3,
        0.05}] // Flatten;
Partition[%, Length[tc15]]

Best regards,
Matthias Bode.
Von: divinesaam at aol.com [mailto:divinesaam at aol.com]
Gesendet: Dienstag, 23. Juli 2002 07:52
An: mathgroup at smc.vnet.net
Betreff: [mg35625] elementwise vector scalar subtraction


Dear Colleagues,

I have a t-vector

t = {0, 1, 1.5, 2, 2.5, 4, 6, 8, 10, 15, 20, 30};

I want to subtract 0.15 from each element except the first to get

tc15 = {0, 1 - 0.15, 1.50 - 0.15, 2 - 0.15, 2.5 - 0.15, 4 - 0.15, 6 -
0.15, 8 - 0.15, 10 - 0.15, 15 - 0.15, 20 - 0.15, 30 - 0.15};
      
I then want to subtract 0.20 to get

tc20 = {0, 1 - 0.20, 1.50 - 0.20, 2 - 0.20, 2.5 - 0.20, 4 - 0.20, 6 -
0.20, 8 - 0.20, 10 - 0.20, 15 - 0.20, 20 - 0.20, 30 - 0.20};
      
Is there a way to automate this process for n subtractions from 0.15
to 0.30 to yield individual t-vectors for tc15 through tc30 ?

With Much Appreciation,

Oscar



  • Prev by Date: Re: elementwise vector scalar subtraction
  • Next by Date: RE: elementwise vector scalar subtraction
  • Previous by thread: Re: AW: Q: Simplify with "much less" assumptions
  • Next by thread: Substitution!!!