⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hmatrix.m

📁 线性代数实验及MATLAB入门,电子工业出版社出版 陈怀琛 龚杰民合著
💻 M
字号:
function H=Hmatrix(n);
% Hmatrix(n) is a matrix of 0's and 1's whose 
% nonzero are in the form of the letter H.
% The first and last columns and the middle row 
% of the matrix consist of 1's. The remaining
% entries are all 0. The input argument n must
% be an odd integer.
if rem(n,2)==0
   error('The input argument for Hmatrix must be odd')
end
H=zeros(n);
H(:,1)=ones(n,1);
H(:,n)=ones(n,1);
H(fix((n+1)/2),:)=ones(1,n);

⌨️ 快捷键说明

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