Matlab identity shift matrix

前端 未结 6 1252
长发绾君心
长发绾君心 2020-12-17 18:38

Is there any inline command to generate shifted identity matrix in MATLAB?

A=[ ...
0, 1, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 1, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 1, 0, 0         


        
6条回答
  •  南笙
    南笙 (楼主)
    2020-12-17 19:25

    Here is another one (also works with negative shifts)

    rot90(blkdiag(zeros(abs(shift)),rot90(eye(n))),sign(shift))
    

提交回复
热议问题