Bonjour,

J'ai une fonction qui place certains éléments dans un tableau (que j'utilise en tant que matrice 3x3).
Je voudrai créer une autre fonction, qui calculerait le determinant de cette matrice. Mais que mettre comme variable pour cette fonction ? Il s'agit d'un tableau de type tableau, mais comment le nomme-t-on ?


Merci par avance pour votre réponse !

Voilà mon problème :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'Jacobian matrix'
Function jacobian(qs, Tw, Tg, Tf)
Dim jacobianmat(2, 2) As Double
jacobianmat(0, 0) = dfwTw(qs, Tw, Tg, Tf)   'A
jacobianmat(0, 1) = dfwTg(qs, Tw, Tg, Tf)   'B
jacobianmat(0, 2) = dfwTf(qs, Tw, Tg, Tf)   'C
jacobianmat(1, 0) = dfgTw(qs, Tw, Tg, Tf)   'D
jacobianmat(1, 1) = dfgTg(qs, Tw, Tg, Tf)   'E
jacobianmat(1, 2) = dfgTf(qs, Tw, Tg, Tf)   'F
jacobianmat(2, 0) = dffTw(Tw, Tg, Tf)       'G
jacobianmat(2, 1) = dffTg(Tw, Tg, Tf)       'H
jacobianmat(2, 2) = dffTf(Tw, Tg, Tf)       'I
End Function
 
'Matrix Determinant'
Function detmatrix()
Dim matr(2, 2) As Double
Dim determinant As Double
matr = jacobian(qs, Tw, Tg, Tf)
determinant = matr(0, 0) * matr(1, 1) * matr(2, 2) + matr(0, 1) * matr(1, 2) * matr(2, 0) + matr(0, 2) * matr(1, 0) * matr(2, 1) - matr(0, 2) * matr(1, 1) * matr(2, 0) - matr(0, 1) * matr(1, 0) * matr(2, 2) - matr(0, 0) * matr(1, 2) * matr(2, 1)
End Function
Et en gros ça me met que matr n'est pas défini en tant que tableau...