ymatrix.m
来自「matlab 在线性代数中的应用 利用matlab实现可以提高对所学知识的理解 」· M 代码 · 共 11 行
M
11 行
function Y=Ymatrix(n)
% The command Y = Ymatrix(n) generates an nxn
% matrix of 0's and 1's in the form of the
% letter. The input argument n must be an odd
% integer.
if rem(n,2)==0
error('The input argument for Ymatrix must be odd')
end
Y=fliplr(eye(n));
Y(1:(n-1)/2,:)=Y(1:(n-1)/2,:)|fliplr(Y(1:(n-1)/2,:));
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?