MathGroup Archive 2012

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

Search the Archive

take square of the second and third column of a table


Hello, suppose I have a very long table like this:

1 2 3
4 5 6
7 8 9
.......
2 3 4

how can I take square of the 2nd and 3rd column? I always do it by
making a new table. so let's say the above table is A and it has 100
lines, then I make the new table as the following:

B=Table[{A[[n]][[1]],A[[n]][[2]]^2,A[[n]][[3]]^2},{n,1,100}]

But if the length of the table is unknown, this way is impractical.
Could anyone suggests better way? thank you



  • Prev by Date: Re: select 1st column element based on criteria in 2nd column in mathematica
  • Next by Date: Minimize: new method vs old method
  • Previous by thread: Re: How to create palette buttons with tooltips?
  • Next by thread: Re: take square of the second and third column of a table