Problem 545. Flip the main diagonal of a matrix
Solution Stats
Problem Comments
-
1 Comment
Additional test cases have been added.
Solution Comments
-
2 Comments
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.
Problem Recent Solvers619
Suggested Problems
-
Number of 1s in the Binary Representation of a Number
400 Solvers
-
Getting the indices from a matrix
568 Solvers
-
Change the sign of even index entries of the reversed vector
423 Solvers
-
Find the dimensions of a matrix
472 Solvers
-
3313 Solvers
More from this Author16
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!