Matrix partition

Hi guys,
Firstly sorry if something wrong about my English. I need a algorithm who design a matrix. Matrix must be N x N. Matrix values are not important. After matrix creation, program will do partition of matrix.
Partition will be diagonal. From 1 x 1 to N x N. There will be 2 matrix and the sum of the two matrix must be equal to the first matrix. Program must write A, B and C matrix. (A = B + C)

Example

First matrix (A)

1 2 
3 4 

New first divided matrix (B)

1 0
0 4

New second divided matrix (C)

0 2
3 0


Thanks a lot!
Last edited on
I think you had better have another go at explaining what you want to do, @BJK. I don't understand your explanation, and, judging by the number of replies, neither did anyone else.

Also, if you want to give a meaningful example, please make it bigger than 2x2. This isn't remotely close to what I would regard as "partitioning" a matrix.
Topic archived. No new replies allowed.