0% found this document useful (0 votes)
2 views1 page

Matrix

The document outlines instructions for creating script files for matrix operations including addition, multiplication, and transpose using Java, C, or C++. It specifies the steps for inputting matrix dimensions, performing calculations, and saving the scripts with designated filenames. Additionally, it includes questions related to arrays, loops, and matrix transposition.

Uploaded by

Aga Balcos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Matrix

The document outlines instructions for creating script files for matrix operations including addition, multiplication, and transpose using Java, C, or C++. It specifies the steps for inputting matrix dimensions, performing calculations, and saving the scripts with designated filenames. Additionally, it includes questions related to arrays, loops, and matrix transposition.

Uploaded by

Aga Balcos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Matrix

Objective:

To be able to create a script file of matrix addition, matrix multiplication and Matrix transpose using
Java/C language/C++.

Material

Java/ C++/C- language


Personal Computer.

Instructions:

A. Matrix Addition

1. Create a script file for adding two matrices.


2. Let m input to enter the number of rows in the Matrix.
3. Let n input to enter the number of columns in the Matrix.
4. Display the sum of the two matrices.
5. Save the script file ADDM using the executable extension file of that software.

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.

You might also like