انا وديته لدكتورة غادة ×_× ، اذا شوفتيني ،
وبرضه مافهمت ايش قالت بالزبط ،..
بس اللي فهمته حنغير بنفس المين وحنستخدم ميثود جديييييييدة عمرنا ماسمعناها خخخخ ،..
انا الحين حتضارب معاه لو لقيتله حل ،. حجي اشرحلك هو
|
مسوري انا كمان كنت حابه اسألها على سؤال 6 .... لاني مو فاهمة هوا اصلا ايش يبغا نكتب مصفوفه ولا ايش ... ولا فاكرة ضرب المصفوفات ...ولا خلصنا المالتي اللي اظن انو يعتمد عليه و حيكون التسليم الاحد قبل المحاضره
نفسي افهم دا الشئ ايش يبغا بالزبط احد يفهمني ؟؟
كود:
Coding Exercise 6
Matrix Inverse
The inverse of a square matrix A is denoted A-1, such that A×A-1 = I, where I is the identity matrix with all 1’s on the diagonal and 0 on all other cells.
The inverse of matrix , for example, is
that is,
The inverse of a 3 × 3 matrix
can be obtained using the following formula if :
.
Implement the following function to obtain an inverse of the matrix:
public static double[][] inverse(double[][] A)
Write a test program that prompts the user to enter , , , , , , , , for a matrix and displays its inverse matrix. Here are the sample runs:
Sample 1
Enter a11, a12, a13, a21, a22, a23, a31, a32, a33: 1 2 1 2 3 1 4 5 3
-2 0.5 0.5
1 0.5 -0.5
1 -1.5 0.5
Sample 2
Enter a11, a12, a13, a21, a22, a23, a31, a32, a33: 1 4 2 2 5 8 2 1 8
2.0 -1.875 1.375
0.0 0.25 -0.25
-0.5 0.4375 -0.1875