ho creato questo codice
Codice: Seleziona tutto
Dim MatNo1#(5, 5), VetSol#(5)
Private Sub Command1_Click()
DimMat% = 5
ParX# = 0
ParY# = 0
For IndRig% = 1 To DimMat%
If IndRig% = 1 Then 'Riempie la prima riga'
ParX# = 0
ParY# = -1
For IndCol% = 1 To DimMat%
If IndCol% = 1 Then
MatNo1#(IndRig%, IndCol%) = ParX# * ParX#
Else
If IndCol% = 2 Then
MatNo1#(IndRig%, IndCol%) = ParX# * ParY#
Else
If IndCol% = 3 Then
MatNo1#(IndRig%, IndCol%) = ParY# * ParY#
Else
If IndCol% = 4 Then
MatNo1#(IndRig%, IndCol%) = ParX#
Else
If IndCol% = 5 Then
MatNo1#(IndRig%, IndCol%) = ParY#
Else: End If
Next IndCol%
Next IndRig%
End Sub