您的位置:程序门 -> .net技术 -> vb.net



急!!!!   实现矩阵转置,即将矩阵的行,列互换,一个3行2列的矩阵将转换为2行3列.


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


急!!!! 实现矩阵转置,即将矩阵的行,列互换,一个3行2列的矩阵将转换为2行3列.
发表于:2007-10-21 10:51:28 楼主
大家给我提示一下这个算法好吗?我想了半天还是不知道该怎么写?
非常感谢!!  
在线等很急!!!
发表于:2007-10-21 16:22:471楼 得分:0
小矩阵用数组转一下就可以了
int[,]   matrix   =new   int[3,2]   {};//原始矩阵
int[,]   resultmatrix   =new   int[2,3]   {};//结果矩阵

for(int   icount=0;icount <   3;icount++)
      for(int   ycount=0;ycount <2;ycount++)
                resultmatrix[icount][ycount]=matrix[ycount][icount];


//resultmatrix为所求


快速检索

最新资讯
热门点击