cyclic.m

来自「matlab 在线性代数中的应用 利用matlab实现可以提高对所学知识的理解 」· M 代码 · 共 8 行

M
8 行
字号
function C=cyclic(n)
% The command cyclic(n) generates an nxn matrix
% with 1's on the diagonal just above the main
% diagonal and a 1 in the lower left hand corner. 
% The remaining entries of the matrix are all 0.
C=diag(ones(n-1,1),1);
C(n,1)=1;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?