VB高手用VB编写下面编转置矩阵

Option ExplicitOption Base 1Dim a(4, 4) As IntegerPrivate Sub Command1_Click()Dim i As Integer, j As IntegerPicture1.ClsRandomizeFor i = 1 To 4 For j = 1 To 4 a(i, j) = Int(Rnd * 9) + 1 Picture1.Print a(i, j); Next j Picture1.PrintNext iEnd

Private Sub Command1_Click()Randomize TimerDim n As Integer, m As IntegerDim arr1() As Integer, arr2() As IntegerDim i As Integer, j As Integern = InputBox("请输入矩阵的行数")m = InputBox("请输入矩阵的列数")ReDim arr1(1 To

dim A(1 to m,1 to n)'定义m行n列矩阵for i=1 to mfor j=1 to nA(i,j)=1'给矩阵赋值next jnext ifor i=1 to nfor j=1 to mprint a(i,j);next jprintnext i'打印转置矩阵

Private Sub Form_Click() Dim n, m, i, j, Matrix(), Cache() As Integer n = CInt(InputBox("请输入矩阵行数N", "矩阵置换")) m = CInt(InputBox("请输入矩阵列数M", "矩阵置换")) ReDim Matrix(n - 1, m - 1) ReDim Cache(m - 1, n - 1) '录入

两层循环 外层i变量0-2 内层j变量0-2 循环里面nx2(i,j)=nx1(j,i)

dim a(6, 6) as integer, i as integer, ii as integerprivate sub command1_click() for i = 1 to 6 for ii = 1 to 4 a(i, ii) = int(rnd * 90 + 10) next ii next i for i = 1 to 6 for ii = 1 to 4 picture1.print a(i, ii); next ii picture1.print "" next iend subprivate sub command

初始化二维2*3矩阵:Dim MyArray(1,2) As Integer 然后运行过程中加入代码定义二维3*2矩阵:ReDim Preserve MyArray(2,1) As Integer 再用一个镶嵌ForNext循环把值赋值过来就可以啦,很简单嘛.

转置,可利用数组将a(i,j)的值赋给b(j,i),然后输出数组b既可. 求矩阵的逆程序 在窗体中加入俩个标签控件,文本框控件(尺寸不要太大(700,700)),并将文本框的index属性设为0 Dim n%, a() Private Sub Form_Load() Me.Top = 800: Me.

好好复习下线性代数的知识吧,别浪费积分了.

Private Sub Command1_Click()Dim A(3, 2) As IntegerDim B(2, 3) As IntegerDim i As Integer, j As IntegerFor i = 0 To 3For j = 0 To 2A(i, j) = i * 3 + j + 1Debug.Print A(i, j),Next jDebug.PrintNext iDebug.PrintFor i = 0 To 2For j = 0 To 3B(i, j) = A(j, i)Debug.Print B(i, j),Next jDebug.PrintNext iEnd Sub

相关文档

vb实现矩阵的转置
编程求矩阵的转置
vb中转置矩阵代码
vb随机矩阵转置3x4
vb矩阵转置
vb编程系列4矩阵转置
vb矩阵交换行
如何用vb对矩阵转置
求下列矩阵的转置矩阵vb
编写程序 实现矩阵的转置
vb矩阵的基本运算代码
vb实现矩阵行列转置
利用vb实现矩阵的转置
编程序一个矩阵的转置
vb实现以下矩阵转置
vb一维数组编程
编写程序实现矩阵的转置
vb矩阵运算
电脑版