Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please help me as early as possible to solve the problem of matrix multiplication
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
       ar1txt.Text = "2"
       ai1txt.Text = "3"
       ar2txt.Text = "4"
       ai2txt.Text = "5"
       ar3txt.Text = "6"
       ai3txt.Text = "7"
       ar4txt.Text = "8"
       ai4txt.Text = "9"


       br1txt.Text = "2"
       bi1txt.Text = "3"
       br2txt.Text = "4"
       bi2txt.Text = "5"
       br3txt.Text = "6"
       bi3txt.Text = "7"
       br4txt.Text = "8"
       bi4txt.Text = "9"


       Dim A(0 To 10, 0 To 10) As Double
       Dim B(0 To 10, 0 To 10) As Double
       Dim Product(0 To 10, 0 To 10) As Double
       Dim J As Integer
       Dim K As Integer
       Dim X As Integer
       For J = 0 To 10
           For K = 0 To 10
               Product(J, K) = A(J, X) * B(X, K)
               For X = 1 To 10
                   Product(J, K) = Product(J, K) + A(J, X) * B(X, K)
               Next X
           Next K
       Next J
       ans1txt.Text = Product(J, K)
       ans2txt.Text = Product(J, K)
       ans3txt.Text = Product(J, K)
       ans4txt.Text = Product(J, K)

   End Sub



this is my code for matrix multiplication
but getting error as "Index was outside the bounds of the array"
please tell me where its getting wrong
Posted
Comments
Prasad_Kulkarni 13-Jul-12 2:50am    
You've already ask'd this question:
matrix multiplication class for vb.net[^]
Don't re-post your questions, If you want to modify or update your question then use 'Improve question' widget. But don't re-post it.
Sandeep Mewara 13-Jul-12 2:56am    
You have 11x11 matrix. Did you wanted that?

Did you DEBUG it and see where issue was happening? Lot of code is missing. Debug it and then post related snippet where error happens (in case you are unable to figure it out)
arizan 13-Jul-12 3:01am    
its not 11*11 matirx
i am developing code for complex matrix ar1 is for real no and ai1 is for imaginary no.

1 solution

You can find the good example of matrix calculation here
http://www.a1vbcode.com/app-2384.asp[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900