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

📄 shpf.m

📁 控制系统计算机辅助设计——MATLAB语言与应用(源代码)
💻 M
字号:
function f=shpf(x,m,n)
%SHPF   Reshape matrix into MVFR matrix
%       SHPF(X,m)  reshapes the columns of X into an MVFR matrix
%       with square component matrices m-by-m.
%       X is a matrix with one column per element of the MVFR matrix
%       and one row per frequency. Each row is reshaped into a
%       component matrix using A(:) where A=eye(n).
%
%       SHPF(X,m,n) reshapes the rows of X into component matrices
%       with m rows and n columns.
%
%       SHPF(X,A) reshape the row of X into component matrices the
%       same size as A.
%       See also FGET

%       Dr M.P. Ford 4th August 1987
% Copyright (c) 1987 by GEC Engineering Research Centre & Cambridge Control Ltd

nargs=nargin;
error(nargchk(2,3,nargs));
[mx,nx]=size(x);
if nargs==2
   a=eye(m);
else
   a=eye(m,n);
end
[m,n]=size(a);
if m*n~=nx
   error('Size not consistent with number of columns of X')
end
k=1:m;
for i=0:mx-1
   a(:)=x(i+1,:);
   f(k+i*m,:)=a;
end

⌨️ 快捷键说明

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