Matrix
Matrix
Objective:
To be able to create a script file of matrix addition, matrix multiplication and Matrix transpose using
Java/C language/C++.
Material
Instructions:
A. Matrix Addition
B. Matrix Multiplication
1. Create a script file for matrix multiplication.
2. Let m input to enter the number of rows in the 1st Matrix.
3. Let n input to enter the number of columns in the 1st Matrix.
4. Let p input to enter the number of rows in the 2nd Matrix.
5. Let n input to enter the number of column in the 2nd Matrix.
6. Display the product of the two matrices.
7. Save the file in MULTM
C. Matrix Transpose
1. The transpose of an m x n matrix A is n x m matrix AT.
2. Formed by interchanging rows into columns and vice versa.
3. (AT)k,j = Aj,k
4. Let m input to enter the number of rows in the Matrix.
5. Let n input to enter the number of columns in the Matrix.
6. Display the transpose matrix
7. Save the file TRANSPM
Questions:
1. What do you mean by an array?
2. Differentiate between for loop and while loop.
3. Define transpose of matrix? What will be the order of the matrix AT, if the order of the matrix A
is 4 x 4.