PDA

View Full Version : matrix structures problem

moonpecs
07-29-2011, 06:38 AM
im writing a code in matrix form for my numerical subject...please i badly needed your help guys...i cant find the correct code for the matrix pattern shown below..
the code can simply be written by using a for loop only for that matrix size (shown below) and it has a 14 x 14...but i want to write a general code that is applicable to any size...and my actual problem is 2000 by 2000 matrix.....

0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0

Bob Phillips
08-01-2011, 07:50 AM
What determines whether the value is 0 or 1? And how do you want to define the size of the matrix?

moonpecs
08-01-2011, 10:11 AM
What determines whether the value is 0 or 1? And how do you want to define the size of the matrix?

by increasing the size of the array, say from 1 to 2000.......

Bob Phillips
08-01-2011, 02:30 PM
Sorry, which question does that answer, and I don't understand anyway.

halimi1306
08-09-2011, 11:13 PM
Are u trying to make an Identity matrix?

im writing a code in matrix form for my numerical subject...please i badly needed your help guys...i cant find the correct code for the matrix pattern shown below..
the code can simply be written by using a for loop only for that matrix size (shown below) and it has a 14 x 14...but i want to write a general code that is applicable to any size...and my actual problem is 2000 by 2000 matrix.....

0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0