Re: How To Break Long List to m-by-n MatrixForm
- To: mathgroup at smc.vnet.net
- Subject: [mg119018] Re: How To Break Long List to m-by-n MatrixForm
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Fri, 20 May 2011 06:34:41 -0400 (EDT)
data = Range[60];
Partition[data, 12]
{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, {13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24}, {25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36}, {37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48}, {49, 50, 51,
52, 53, 54, 55, 56, 57, 58, 59, 60}}
Dimensions[%]
{5, 12}
Bob Hanlon
---- Afolabicrystal <afolabicrystal at gmail.com> wrote:
=============
Hello Friends,
I have a fundamental question.
Given a long List of elements (say 60 elements). How do I break this
to an m-by-n MatrixForm (say 5-by-12).
It's kinda basic and I already feel silly asking the question. Simple
things do elude big brains sometimes. Any idea?
Thankx.