matrix step shift in each row
显示 更早的评论
HI
i have equestion about matrix shift numbers . for example i have this matrix
A =[ 1 2 3 4 5 ]
i want it to be
A =
1 2 3 4 5
5 1 2 3 4
4 5 1 2 3
3 4 5 1 2
2 3 4 5 1
thank you very much for helping
2 个评论
Rik
2021-2-23
Do the numbers in A mean anything (e.g. the number of positions the corresponding row should be shifted), or are you simply asking about a row-wise circshift?
mohammed hussein
2021-2-23
采纳的回答
更多回答(1 个)
A = [1,2,3,4,5];
B = toeplitz(A([1,end:-1:2]),A)
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!