Bonjour, j'aimerais faire le produit matriciel entre l'inverse d'une matrice et une matrice colonne. J'ai pour erreur "l'indice n'appartient pas à la séléction" pour
MatriceX2(i - 1, 0) = P(i - 1, 0) * X(i - 1, 0) + _
P(i - 1, 1) * X(i - 1, 0) + _
P(i - 1, 2) * X(i - 1, 0)
Pouvez-vous m'aider s'il vous plait ?
Function Pinv(Angle As Double) As Variant
Dim Matinverse() As Variant
'Calcule de la matrice iverse
Matinverse = Application.MInverse(Range("B2729"))
Pinv = Matinverse
End Function
Function Mat_X(Angle As Double) As Variant
Dim MatIntX(3, 1) As Double
'Détermination de la matrice X
MatIntX(0, 0) = Cells(5, 8)
MatIntX(1, 0) = Cells(6, 8)
MatIntX(2, 0) = Cells(7, 8)
Mat_X = MatIntX
End Function
Function Mat_ProdPX(Angle As Double) As Variant
'M1M2 = P
'X2 = X'
'Initialisation
Dim MatriceX2(3, 1) As Double
Dim P As Variant
Dim X As Variant
Dim i, j As Integer
'Calcule de X'=Pinv*X
P = Pinv(Angle)
X = Mat_X(Angle)
For i = 1 To 3
MatriceX2(i - 1, 0) = P(i - 1, 0) * X(i - 1, 0) + _
P(i - 1, 1) * X(i - 1, 0) + _
P(i - 1, 2) * X(i - 1, 0)
Cells(13 + i, 8) = MatriceX2(i - 1, 0)
Next i
End Function
MatriceX2(i - 1, 0) = P(i - 1, 0) * X(i - 1, 0) + _
P(i - 1, 1) * X(i - 1, 0) + _
P(i - 1, 2) * X(i - 1, 0)
Pouvez-vous m'aider s'il vous plait ?
Function Pinv(Angle As Double) As Variant
Dim Matinverse() As Variant
'Calcule de la matrice iverse
Matinverse = Application.MInverse(Range("B2729"))
Pinv = Matinverse
End Function
Function Mat_X(Angle As Double) As Variant
Dim MatIntX(3, 1) As Double
'Détermination de la matrice X
MatIntX(0, 0) = Cells(5, 8)
MatIntX(1, 0) = Cells(6, 8)
MatIntX(2, 0) = Cells(7, 8)
Mat_X = MatIntX
End Function
Function Mat_ProdPX(Angle As Double) As Variant
'M1M2 = P
'X2 = X'
'Initialisation
Dim MatriceX2(3, 1) As Double
Dim P As Variant
Dim X As Variant
Dim i, j As Integer
'Calcule de X'=Pinv*X
P = Pinv(Angle)
X = Mat_X(Angle)
For i = 1 To 3
MatriceX2(i - 1, 0) = P(i - 1, 0) * X(i - 1, 0) + _
P(i - 1, 1) * X(i - 1, 0) + _
P(i - 1, 2) * X(i - 1, 0)
Cells(13 + i, 8) = MatriceX2(i - 1, 0)
Next i
End Function