Re: How to deal with big matrix?
- To: mathgroup at smc.vnet.net
- Subject: [mg116638] Re: How to deal with big matrix?
- From: Szymon Roziewski <szymon.roziewski at gmail.com>
- Date: Tue, 22 Feb 2011 04:44:31 -0500 (EST)
Hi,
Thank you for all of you.
Your resolutions work well.
Kind regards,
Szymon Roziewski
2011/2/22 Bob Hanlon <hanlonr at cox.net>
>
> data = Table[{x[i, j], y[i, j]}, {i, 3}, {j, 4}]
>
> {{{x[1, 1], y[1, 1]}, {x[1, 2], y[1, 2]}, {x[1, 3],
> y[1, 3]}, {x[1, 4], y[1, 4]}}, {{x[2, 1], y[2, 1]}, {x[2, 2],
> y[2, 2]}, {x[2, 3], y[2, 3]}, {x[2, 4], y[2, 4]}}, {{x[3, 1],
> y[3, 1]}, {x[3, 2], y[3, 2]}, {x[3, 3], y[3, 3]}, {x[3, 4],
> y[3, 4]}}}
>
> Flatten[data[[All, All, 1]], 1]
>
> {x[1, 1], x[1, 2], x[1, 3], x[1, 4], x[2, 1], x[2, 2], x[2, 3],
> x[2, 4], x[3, 1], x[3, 2], x[3, 3], x[3, 4]}
>
> Flatten[data[[All, All, 2]], 1]
>
> {y[1, 1], y[1, 2], y[1, 3], y[1, 4], y[2, 1], y[2, 2], y[2, 3],
> y[2, 4], y[3, 1], y[3, 2], y[3, 3], y[3, 4]}
>
>
> Bob Hanlon
>
> ---- Szymon Roziewski <szymon.roziewski at gmail.com> wrote:
>
> =============
> Hello there,
>
> I have quite big matrix with let say 1000 rows and 1100 columns.
> Each of element of this matrix is a point on a surface e.g. {1.232,12.123}
> How can I quickly get first element of each point for whole matrix and put
> it in a vector (1000*1100 - this will be a length of that vector) without
> do
> it in a nested loop (Do[Do[...]])?
> And the similar to get the second element of each point into vector.
>
> kind regards,
> Szymon Roziewski
>
>
--
Z wyrazami szacunku,
Szymon Roziewski
Bob Hanlon<br>