Professional Documents
Culture Documents
Actividad Sugerida
Desarrolle una aplicación que le permita convertir una matriz cualquiera en una matriz
simétrica positiva
INTERFAZ
B.Rows.Add(4)
B.Rows(1).Cells(0).Value = "fila1"
B.Rows(2).Cells(0).Value = "fila2"
B.Rows(3).Cells(0).Value = "fila3"
B.Rows(4).Cells(0).Value = "fila4"
B.Rows(1).Cells(1).Value = -2
B.Rows(1).Cells(2).Value = 3.2
B.Rows(1).Cells(3).Value = 3.4
B.Rows(1).Cells(4).Value = 2.6
B.Rows(2).Cells(1).Value = 1.1
B.Rows(2).Cells(2).Value = 2.1
B.Rows(2).Cells(3).Value = 2.3
B.Rows(2).Cells(4).Value = 1.1
B.Rows(3).Cells(1).Value = -2
B.Rows(3).Cells(2).Value = 3.2
B.Rows(3).Cells(3).Value = 4.1
B.Rows(3).Cells(4).Value = -3.2
B.Rows(4).Cells(1).Value = -1.8
B.Rows(4).Cells(2).Value = 2.2
B.Rows(4).Cells(3).Value = 3.2
B.Rows(4).Cells(4).Value = 2.4
C.Rows.Add(4)
C.Rows(1).Cells(0).Value = "fila1"
C.Rows(2).Cells(0).Value = "fila2"
C.Rows(3).Cells(0).Value = "fila3"
C.Rows(4).Cells(0).Value = "fila4"
End Sub
c1 = (A.Rows(1).Cells(5).Value) / l(1, 1)
c2 = ((A.Rows(2).Cells(5).Value) - l(2, 1) * c1) / l(2, 2)
c3 = ((A.Rows(3).Cells(5).Value) - l(3, 1) * c1 - l(3, 2) * c2) / l(3, 3)
c4 = ((A.Rows(4).Cells(5).Value) - l(4, 1) * c1 - l(4, 2) * c2) / l(4, 4)
x4 = c4 / l(4, 4)
x3 = (c3 - l(4, 3) * x4) / l(3, 3)
x2 = (c2 - l(3, 2) * x3 - l(4, 2) * x4) / l(2, 2)
x1 = (c1 - l(1, 2) * x2 - l(1, 3) * x3 - l(1, 4) * x4) / l(1, 1)
txtx1.Text = x1
txtx2.Text = x2
txtx3.Text = x3
txtx4.Text = x4
End Sub
End Class
Y luego con la formula hara que los datos de X1, X2, X3 y X4 tengan 4 decimales