0% found this document useful (0 votes)
15 views

Multiplication Problem Statement

This document presents a problem statement and algorithm for multiplying matrices. It defines that for matrices to be multiplied, the number of rows in the first matrix must equal the number of columns in the second. It provides test cases of multiplying two matrices and displays the results. The algorithm uses for loops to iterate through the matrices and calculate the product, storing the results in a new "product" matrix.

Uploaded by

Patrick LaGrone
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Multiplication Problem Statement

This document presents a problem statement and algorithm for multiplying matrices. It defines that for matrices to be multiplied, the number of rows in the first matrix must equal the number of columns in the second. It provides test cases of multiplying two matrices and displays the results. The algorithm uses for loops to iterate through the matrices and calculate the product, storing the results in a new "product" matrix.

Uploaded by

Patrick LaGrone
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Jonathan P.

LaGrone Problem Statement (Multiplying Matrices)

Final Project

Aero 220-500

We are asked to find the multiplication between two matrices where the matrices are any real numbers. In order to multiply two matrices, the number of rows in the first matrix must have the same number of columns in the second matrix.

Test Case Matrix 1= 1 4 1 2 5 3

Matrix 2= 4 1 5 4 6 8

Matrix 1*Matrix 2= 6 21 7 13 40 17 22 64 30

Matrix 2 * Matrix 1= 30 25 51 46

Algorithm 1) void Matrixclass::multiplication(Matrixclass z, ofstream&outfile)//Main function for Multiplication a. Matrixclass product(height, z.width) b. for (int i=0; i<product.height; i++) //for loops for the resultant matrix c. for (int j=0; j<product.width; j++) d. for (int k=0; k<z.height; k++) i. product.matrix[i][j]+=matrix[i][k]*z.matrix[k][j]//the formula for multiplying two matrices 2) product.display(outfile)//displays the product matrix in a text file

Jonathan P. LaGrone

Final Project

Aero 220-500

You might also like