Précédent   Forum des professionnels en informatique > Logiciels > Microsoft Office > Excel > Macros et VBA Excel
Macros et VBA Excel Vos questions relatives aux macros Excel, à l'utilisation de VBA et à l'automatisation de vos classeurs Excel.
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 13/10/2011, 20h14   #1
Invité de passage
 
Inscription : mars 2010
Messages : 39
Détails du profil
Informations forums :
Inscription : mars 2010
Messages : 39
Points : 3
Points : 3
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 :
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...
Sylv3D est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 04h53.


 
 
 
 
Partenaires

Hébergement Web