Home > Software engineering >  Great god seeks advice on VB production of orthogonal table, please! Please!
Great god seeks advice on VB production of orthogonal table, please! Please!

Time:09-29

Asked to do a four factors three levels orthogonal table
Below is the code
I 0 basis, the examination to test, has been studying for a long time
Finally click commond no errors but gave birth to become a really don't know why?
And that in the end, MESHGRID controls is to show how to adjust?
Thank you very much!
Private Sub Command1_Click ()
'the first horizontal arrangement
Dim zs, ma
For j=1 To Form1 Text4. Text
For k=j + 1 To j * * zs - zs zs
Ma (k, 1)=j
Next k
Next j
'the second factor of horizontal arrangement
For j=1 To zs
For k=j * Form1 Text3. Text - Form1. Text3. Text To (j * Form1 Text3. Text)
Ma (k, 2)=k - j * Form1 Text3. Text
Next k
Next j
'before looking for a factor experiment is arranged in a horizontal position
Dim ec, st
For l=3 To Form1. Text2. Text
For I=1 To Form1. Text4. Text
K=0
For j=1 To ec
If ma (j, l - 1)=I Then
K=k + 1
St (k + 1)=j
End the If
Next j
Next I
Next l
'level of random arrangement under the current factors
Dim ss
For j=1 To zs
For I=1 To Form1. Text4. Text
Ss (I, j)=j + I - 1
Do the While (ss (j, I) & gt; Form1. Text4. Text)
Ss (j, I)=ss (j, I) - Form1. Text4. Text
Loop
Ma st (j, I), (l)=ss (j, I)
Next I
Next j
'using MESHGRID controls to display the orthogonal table
For l=1 To Form1. Text2. Text
For I=1 To (ec)
Form1. MSFlexGrid1. TextMatrix (I, l)=ma (I, l)
Next I
Next l















End Sub
  • Related