- 3

Two integers on first line in each file with specify number of rows and columns in each matrix, and the elements on next line?

Write a PYTHON program that can read two matrices of arbitrary size from two input disk files and multiply them if they are of compatible sizes. If they are of incompatible sizes, an appropriate error message should be printed. Two integers on the first line in each file with specify the number of rows and columns in each matrix, and the elements in each row of the matrix will appear on a single line of the input file. Use allocatable arrays to hold the input matrices and the resulting output matrix. Verify your program by creating two input data files containing matrices of the compatible sizes calculating the resulting values, and checking the answers by hand. Also verify the proper behaviour of the program if it is given two matrices of incompatible sizes.

6th Sep 2021, 1:38 PM
Amusat Gafar Akinade
Amusat Gafar Akinade - avatar
1 Odpowiedź
0
If you want people to do your work for you, go hire a freelancer.
6th Sep 2021, 5:52 PM
Simon Sauter
Simon Sauter - avatar