4. Assume we have an n x n matrix A (n at least 2). In linear algebra the invers
ID: 3847284 • Letter: 4
Question
4. Assume we have an n x n matrix A (n at least 2). In linear algebra the inverse of this matrix can be found by completing the following steps. Determine for each element in A its minor. Recall the minor of element a is the determinant of the matrix resulting from removing row i and column j (you may use the built in det function in this program) Determine for each element in A its cofactor. Recall the cofactor of element a is its minor multiplied by (-1) Transpose the cofactor matrix (you may not use the transpose function or for this program) but must rather design a way to do this manually Divide this resulting matrix by the determinate of A Write a SCRIPT which reads in a matrix A stored in a text file (the first line being m and the rest of the lines being the n? numbers in row order. Have your script compute the matrix of minors and display it to the screen (you may not use disp or lack of suppression). The have your program compute the cofactor matrix and print it to the screen. Then have your program transpose this matrix and print it to the screen. Next have your program determine and print the inverse of the original matrix use 4 decimal places in a 9 number field for each number) Finally have your program print out using the matrices the equation A A C where Cis com puted by you as the product of A and A 1 (not using the built in matrix math but rather using the definition of matrix multiplyExplanation / Answer
#!/bin/bash filename=file.txt declare -a myArray myArray=(`cat "$filename"`) for (( i = 0 ; i < 9 ; i++)) do echo "Element [$i]: ${myArray[$i]}" doneRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.