Addition & multiplication of two matrices in PHP
15CSL77
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT
program
Write the PHP programs to do the following:
- Find the transpose of a matrix.
- Multiplication of two matrices.
- Addition of two matrices.
Basic Concepts
If a[i][j] and b[i][j] is two matrix then:
- Transpose of a[i][j] will be a[j][i]
- Addition of matrix will be a[i][j]+b[i][j]
- Mutiplication :- for multiplication we cant multiply directley we have to create new matrix supose result[i][j]=0 which will be the result of product of two matrix if Result[i][j]+=a[i][k]*b[i][k]
Addition & multiplication of two matrices in PHP Code
Output:
Addition & multiplication of two matrices in PHP output |
No comments:
For Query and doubts!