1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Split a Matrix into and arbitrary number of blocks

  1. Mar 30, 2013 #1
    Hello,

    i am trying to solve the following problem, but with no success. I need to find a way to split a matrix with dimensions N x M into an arbitrary number of blocks P.

    Not all blocks need to have the same size, say if we have a 16 x 25 matrix and want to split it into 8 blocks, we could get six 6 x 8 submatrices, and the remaining two have one extra column.

    The thing is, although some situations are easy to solve, like the aformentioned one, i am having trouble in finding a general method to split an arbitrary matrix into a arbitrary number of blocks.

    Note: when i say that not all matrices are required to have the same size, i was mentioning ending at a situation like the above mentioned, where the last column of blocks had one extra column of elements.

    Thanks in advance
     
  2. jcsd
  3. Mar 30, 2013 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    Do you have any additional requirements for the blocks? There are many ways to split a matrix into blocks.
     
  4. Mar 30, 2013 #3
    No i don't

    No i don't, just the above mentioned.
     
  5. Mar 31, 2013 #4

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    To divide the matrix in X blocks, find numbers p,q with p*q=X and p<N, q<M. Split the rows into p parts and the columns into q parts, make blocks, done.
    Like that?

    Note that this just gives a special class of blocks, where the block borders are aligned.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Split a Matrix into and arbitrary number of blocks
Loading...