逐行读取矩阵行并输出

时间:2013-03-25 19:20:43

标签: loops matrix wolfram-mathematica

我有一个问题,如何逐个读取矩阵行?

我已经使用命令:

rows = Table[assembly[[a]], {a, 16}]
Table[Position[rows, bar][[All, 2]], {bar, 150}]
MatrixForm[Position[rows, 49]]
baris = Flatten[Position[rows, 49], 1]
Table[Position[rows, kol][[All, 2]], {kol, 150}]
MatrixForm[Position[rows, 50]]
kolom = Flatten[Position[rows, 50], 1]
{Table[Position[rows, bar][[All, 2]], {bar, 150}], 
 Table[Position[rows, kol][[All, 2]], {kol, 150}]}

最后,我不能简单地从我的矩阵16x24创建矩阵150x150。 如何在mathematica中实现?

谢谢你

PS:这是装配矩阵:

  {1, 2, 3, 4, 5, 6, 10, 11, 12, 7, 8, 9, 31, 32, 33, 34, 35, 36, 40, 
   41, 42, 37, 38, 39},
  {7, 8, 9, 10, 11, 12, 16, 17, 18, 13, 14, 15, 37, 38, 39, 40, 41, 
   42, 46, 47, 48, 43, 44, 45},
  {13, 14, 15, 16, 17, 18, 22, 23, 24, 19, 20, 21, 43, 44, 45, 46, 47,
    48, 52, 53, 54, 49, 50, 51},
  {19, 20, 21, 22, 23, 24, 28, 29, 30, 25, 26, 27, 49, 50, 51, 52, 53,
    54, 58, 59, 60, 55, 56, 57},
  {31, 32, 33, 34, 35, 36, 40, 41, 42, 37, 38, 39, 61, 62, 63, 64, 65,
    66, 70, 71, 72, 67, 68, 69},
  {37, 38, 39, 40, 41, 42, 46, 47, 48, 43, 44, 45, 67, 68, 69, 70, 71,
    72, 76, 77, 78, 73, 74, 75},
  {43, 44, 45, 46, 47, 48, 52, 53, 54, 49, 50, 51, 73, 74, 75, 76, 77,
    78, 82, 83, 84, 79, 80, 81},
  {49, 50, 51, 52, 53, 54, 58, 59, 60, 55, 56, 57, 79, 80, 81, 82, 83,
    84, 88, 89, 90, 85, 86, 87},
  {61, 62, 63, 64, 65, 66, 70, 71, 72, 67, 68, 69, 91, 92, 93, 94, 95,
    96, 100, 101, 102, 97, 98, 99},
  {67, 68, 69, 70, 71, 72, 76, 77, 78, 73, 74, 75, 97, 98, 99, 100, 
   101, 102, 106, 107, 108, 103, 104, 105},
  {73, 74, 75, 76, 77, 78, 82, 83, 84, 79, 80, 81, 103, 104, 105, 106,
    107, 108, 112, 113, 114, 109, 110, 111},
  {79, 80, 81, 82, 83, 84, 88, 89, 90, 85, 86, 87, 109, 110, 111, 112,
    113, 114, 118, 119, 120, 115, 116, 117},
  {91, 92, 93, 94, 95, 96, 100, 101, 102, 97, 98, 99, 121, 122, 123, 
   124, 125, 126, 130, 131, 132, 127, 128, 129},
  {97, 98, 99, 100, 101, 102, 106, 107, 108, 103, 104, 105, 127, 128, 
   129, 130, 131, 132, 136, 137, 138, 133, 134, 135},
  {103, 104, 105, 106, 107, 108, 112, 113, 114, 109, 110, 111, 133, 
   134, 135, 136, 137, 138, 142, 143, 144, 139, 140, 141},
  {109, 110, 111, 112, 113, 114, 118, 119, 120, 115, 116, 117, 139, 
   140, 141, 142, 143, 144, 148, 149, 150, 145, 146, 147}

0 个答案:

没有答案