Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你能帮我处理这种类型的对角矩阵吗?
| 1| | 1 | | 1 | I=| 1 | | 1 | | 1 | |1 |
我不知道如何在Matlab中做到这一点。
您可以使用
fliplr(eye(7))
这导致
ans = 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0
更多选项(为了完整起见):
rot90(eye(7)) flipud(eye(7))