1. Write the following functions: (a) void transpose( float A[6][6], float B[6][
ID: 3639745 • Letter: 1
Question
1. Write the following functions:
(a) void transpose( float A[6][6], float B[6][6] )
the function transposes the matrix A and writes it into the matrix B
(b) void multiply( float A[6][6], float B[6][3], float C[6][3] )
the function multiplies matrix A with matrix B and writes the product into matrix C
(c) float determinant( float A[6][6] )
the function returns the determinant of the matrix A
Write a program that reads two matrices X(6,6) and Y(6,3), and uses the above functions to show the transpose of X, product of X and Y, and determinant of X.
How to compute the determinant? Use Gaussian elimination to transform the matrix into a triangular matrix, and then simply compute the product of the diagonal elements. If you are not aware of Gaussian elimination, then please look up the site:
Explanation / Answer
#include void transpose( float A[6][6],float B[6][6] ); void multiply( float A[6][6],float B[6][3],float C[6][3] ); void ex( float A[6][6],int i,int k ); float determinant( float A[6][6] ); main() { float P[6][6],Q[6][6],R[6][3],S[6][3],D; int i,j; printf(" Enter the elements of X row-wise: "); for(i=0;iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.