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

📄 fadd.m

📁 控制系统计算机辅助设计——MATLAB语言与应用(源代码)
💻 M
字号:
function fout=fadd(w,f,c)
%FADD   Add matrix to MVFR matrix
%       FADD(W,F,C) adds the matrix C to each
%       component matrix of the MVFR matrix F.
%       W is the associated frequency vector.
%       See also FADDF,FMULF,FMUL

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


[m,n]=fsize(w,f);
lw=length(w);
[mc,nc]=size(c);
if (mc~=m)|(nc~=n)
   error('Matrix not the same size as the component matrices');
end
fout=zeros(m*lw,n);   % Set up output matrix
k=1:m;               % vector of rows of each matrix in F
for i=0:lw-1          % for each frequency
    fout(k+i*m,:)=f(k+i*m,:)+c;
end % for i=0:lw-1

⌨️ 快捷键说明

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