转换非方矩阵 [英] transpose of a non square matrix

查看:113
本文介绍了转换非方矩阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以通过ging代码帮助我找到非方形矩阵的转置... plz给出解决这个问题的步骤或者给出代码,如果你可以在c#上的许多例子中显示仅用于方形矩阵的代码..

解决方案

你知道矩阵的转置是这样定义的:



A T ij = A ji



这意味着,例如, 2x3 矩阵,转置,将变为 3x2



假设输入矩阵是由数组 a 表示,维度 M,N ,您的代码必须:

  • 创建一个新数组,比如 b ,维度 N,M。
  • 根据上述规则设置所有新数组项,即 b [i] [j] = a [j] [i]




这就是全部。


看起来像家庭作业?



尝试这里 [ ^ ]


I不能给你一个例子,但是Math.Net Numerics可以做到这一点:



http://mathnetnumerics.codeplex.com/ [ ^ ]

can anyone help me in finding the transpose of a non square matrix by ging code...plz give steps to solve this or give code if u can in c# many examples on internet show code only for square matrix..

解决方案

You know the transpose of a matrix is defined this way:

ATij = Aji

That implies that, for instance, a 2x3 matrix, transposed, will become 3x2.

Suppose the input matrix is represented by an array a having dimensions M,N, your code has to:
  • Create a new array, say b, having dimensions N,M.
  • Set all the new array items according to the above rule, namely b[i][j] = a[j][i].


That's all.


Looks like homework?

Try here[^]


I can't give you an example, but Math.Net Numerics can do it:

http://mathnetnumerics.codeplex.com/[^]


这篇关于转换非方矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆