Wolfram ResearchProductsPurchasingServices & ResourcesAbout UsOur Sites
Student Support Forum
-----
Student Support Forum: 'Extracting data from matrix to another matrix' topicStudent Support Forum > General > Archives > "Extracting data from matrix to another matrix"

< Previous CommentHelp | Reply To Comment | Reply To Topic | Post New Topic
Author Comment/Response
Randy Silvers
05/18/08 03:19am

You'll want to use Partition and Take. If your data is in the matrix mat, and num is the number of rows per country (31 in your case)

Partition[mat,num] generates a three-dimensional matrix -- the first dimension is the number of countries, and each of these "elements" is a matrix with 31 rows.

Then, Map[Take[#,numvars]&,Partition[mat,num]] will take the first numvars rows from each element of the partitioned mat. For your current data set, you want Map[Take[#,10]&,Partition[mat,31]]


URL: sirandol@deakin.edu.au,

Subject (listing for 'Extracting data from matrix to another matrix')
Author Date Posted
Extracting data from matrix to another matrix Thomas 05/15/08 10:18am
Re: Extracting data from matrix to another matrix Randy Silvers 05/18/08 03:19am
< Previous CommentHelp | Reply To Comment | Reply To Topic | Post New Topic





 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy