what is command for circularly writing a row matrix in matlab

1 次查看(过去 30 天)
example: let
a=[1 2 3 4 5]
i want output like
b=[ 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]
please help me

采纳的回答

Walter Roberson
Walter Roberson 2015-9-2
toeplitz() ?
  3 个评论
Satishkumar D
Satishkumar D 2015-9-2
i just tried.. output is getting like below
1 2 3 4
2 1 2 3
3 2 1 2
4 3 2 1
if a=[1 2 3 4 5] but i want output
[ 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]

请先登录,再进行评论。

更多回答(1 个)

Steven Lord
Steven Lord 2015-9-2
gallery('circul', 1:5)

类别

Help CenterFile Exchange 中查找有关 Numbers and Precision 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by