Matrices have a wide range of applications in programming: they're used for digital image processing, graph representation and algorithms on a graph, graphic effects, applied math, statistics, and much more.
Since matrices are tables of numbers, they are usually presented in code as 2D-lists. In this project, you will learn how to read and output matrices, do operations on them, and compute the determinant of a square matrix. At first, you will work with matrices with integer elements, and later the elements will be floating-point numbers.
Objectives In this stage, you should write a program that:
Reads matrix AA from the input. Reads matrix BB from the input. Outputs their sum if it is possible to add them. Otherwise, it should output the ERROR message. Each matrix in the input is given in the following way: the first line contains the number of rows nn and the number of columns mm. Then nn lines follow, each containing mm integers representing one row of the matrix.
Output the result in the same way but don't print the dimensions of the matrix.
- Add matrices
- Multiply matrix by a constant
- Multiply matrices
- Transpose matrix
- Calculate a determinant
- Inverse matrix
- Exit