Advertisement

06.26.2008 at 03:34PM PDT, ID: 23520078
[x]
Attachment Details

matrix multiply

Asked by valleytech in Java Programming Language

please help me to correct bugs in this matrix multiply. ThanksStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
static class MatrixMultiply
	{
 
		double array[][] = {{5,6,7},{4,8,9},{1,1,1}}; // matrix 3x3
		double array1[][] = {{6},{5},{1}};            // matrix 3x1
		double array2[][] = new double[3][1];         // matrix 3x1
 
		void matrixMultiply()
		{
			for(int i = 0; i < 3; i++)
			{
				for(int j = 0; j < 3; j++)
				{
					for(int k = 0; k < 3; k++)
					{
						array2[i][j] += array[i][k]*array1[k][j];
					}
				}
			 }
 
			System.out.println("Multiply of both matrix : ");
			for(int i = 0; i < 3; i++)
			{
				for(int j = 0; j < 1; j++)
				{
					System.out.print(" "+array2[i][j]);
				}
				System.out.println();
			}
 
 
		}
[+][-]06.26.2008 at 03:53PM PDT, ID: 21879747

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Programming Language
Sign Up Now!
Solution Provided By: zhuba
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.26.2008 at 09:08PM PDT, ID: 21880921

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628