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

 Réponse acceptée

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)

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB 快速入门 dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!