Additional test cases have been added.
Dear @bmtran, how can does work? I ask this because you add the vector diag(M) to a matrix. I think you should write
diag(diag(M)) instead of diag(M). Am I wrong?
it should be fairly easy to diagnose what i'm doing if you run each argument of my code separately in MATLAB and look at what it's doing, but I don't wanna give anything away to people who have yet to solve this problem.
10074 Solvers
Compute a dot product of two vectors x and y
754 Solvers
Create an n-by-n null matrix and fill with ones certain positions
280 Solvers
Find out sum of all elements of given Matrix
353 Solvers
621 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!