Write a function to compute the determinant of an n x n matrix with diagonal entries equal to an integer m and other entries equal to 1. For example, a 4x4 matrix with 3s on the diagonal and 1s elsewhere has a determinant of 48, and a 6x6 matrix with 4s on the diagonal and 1s elsewhere has a determinant of 2187. Return the answer as a character string, and see the test suite for forbidden functions.
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers13
Suggested Problems
-
Swap the first and last columns
22584 Solvers
-
Set the array elements whose value is 13 to 0
1438 Solvers
-
Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
252 Solvers
-
350 Solvers
-
Number of Even Elements in Fibonacci Sequence
1638 Solvers
More from this Author323
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!