How to add a diagonal to a matrix?
1 次查看(过去 30 天)
显示 更早的评论
I have the following matrix M=[1 2 3; 4 5 6 ] and I would like to transform it to the follwowing matrix M=[0 1 2; 3 0 4; 5 6 0].
How to do it? It is how to add a zero diagonal to a predefined matrix?
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!