How do I create a program that reads a matrix array and returns me a second matrix composed of zeros and the main diagonal of the first matrix?

1 view (last 30 days)
Example:

Accepted Answer

Guillaume
Guillaume on 9 Nov 2014
Edited: Guillaume on 9 Nov 2014
b = diag(diag(a));

More Answers (0)

Categories

Find more on Data Types in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!