Home > Software engineering >  For bosses to help in the VB program "run-time error '5' : invalid calls or parameter
For bosses to help in the VB program "run-time error '5' : invalid calls or parameter

Time:11-14

I input data to run the program, the program prompts the above errors, found by looking for
A2=W12 + W12, (3) * w1 w2 (4) * + W12 (5) * w3 + B1 (1)
This is one of my middle formula, there are array and variables, I found my lost data from f value is 0, just and VB said it is null,

Specific code below

Private Sub Command1_Click ()

Dim W12 () 'definition array
W12=Array (0.12634521001675, 4.6694806914686, 0.42026116123439, 5.10867971591759, 1.51942107882065, 0.42243980916051, 1.66877957850959, 0.20468373820466, 0.3572928557475, 0.03610001145893, 4.53787321728016, 0.50977927762321)


Dim W23 ()
W23=Array (5.89468238932569, 0.11644047624008, 3.94832907664878, 1.76229980989318)

Dim B1 ()
B1=Array (5.96780654305263, 2.33430134475403, 0.773411222728292, 3.4661792485999)

Const B2 As Double=3.21772616222852

As Single, Dim w1 and w2 As Single, w2, w3 As Single 'define variables w1 w3

Let w1=Val (Text1. Text) 'obtain input sensor measurements
Let w2=Val (Text2. Text) 'access ratio
Let the w3=Val (Text3. Text) 'access to concentration

Dim a1 As the Variant, a2 As the Variant, a3 As the Variant, a4 As the Variant, a11 the As the Variant, a12 As the Variant, a13 As the Variant, a14 defining variables As the Variant '

A1=W12 w1 + W12 (0) * (1) * w2 + W12 w3 + B1 (2) * (0) '
A2=W12 + W12, (3) * w1 w2 (4) * + W12 (5) * w3 + B1 (1)
A3=W12 (6) * w1 + W12 (7) * w2 + W12 (8) * w3 + B1 (2)
A4=W12 (9) * w1 + W12 (10) * w2 + W12 (11) * w3 + B1 (3)
'the a5=W12 (12) * w1 + W12 (13) * w2 + W12 (14) * w3 + B1 (4)'


A11=W23 (0) * 1/(1 + e ^ (a1))
'A12=W23 (1) * 1/(1 + e ^ (a2))
'A13=W23 (2) * 1/(1 + e ^ (a3))
A14=W23 (3) * 1/(1 + e ^ (a4))
''% a15=W23 (4) * logsig (a5)';
% output layer and hidden layer
A=a11 a12 + + a13 + a14 + B2 '; % compiles

W4='a' '% moisture content of the output value (a)
Text4. Text=a

End Sub

CodePudding user response:

Calculation formula to add protection, such as, a2=val (W12 (3) * w1) + val (W12 (4) * w2) + val (W12 (5) * w3) + val (B1 (1)), of course you can add each variable val

CodePudding user response:

Thank you, I'll go back to be debugged