请问如何在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]

 Akzeptierte Antwort

0 Stimmen

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

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB 快速入门 finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!