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?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.