如何在MATLAB中计算n维左循环矩阵的值?

请问如何在MATLAB中输入这个n维左循环矩阵,并计算结果。
A=[-1 0 1 1...0 0 0 0;
0 1 1 0...0 0 0 -1;
1 1 0 0...0 0 -1 1;
1 0 0 0...0 -1 0 1;
0 0 0 0...-1 0 1 1;
......
0 -1 0 1...0 0 0 0]

 Accepted Answer

0 votes

c= [-1 0 1 1 0 0 0];
T = gallery('circul',1:length(c));
indx=[T(1,:);flipud(T(2:end,:))];
c(indx)

More Answers (0)

Categories

Find more on MATLAB 快速入门 in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!