I want to create a special diagonal matrix in MATLAB that
uses [1 1]
or any other array as main diagonal elements.
Something like the following:
[1 1 0 0 0 0
0 0 1 1 0 0
0 0 0 0 1 1]
How can I do that without using any loop structures?