trimr.m

来自「计量工具箱」· M 代码 · 共 28 行

M
28
字号
function z = trimr(x,n1,n2)% PURPOSE: return a matrix (or vector) x stripped of the specified rows.% -----------------------------------------------------% USAGE: z = trimr(x,n1,n2)% where: x = input matrix (or vector) (n x k)%       n1 = first n1 rows to strip%       n2 = last  n2 rows to strip% NOTE: modeled after Gauss trimr function% -----------------------------------------------------% RETURNS: z = x(n1+1:n-n2,:)% -----------------------------------------------------% written by:% James P. LeSage, Dept of Economics% University of Toledo% 2801 W. Bancroft St,% Toledo, OH 43606% jpl@jpl.econ.utoledo.edu  [n junk] = size(x);  if (n1+n2) >= n;      error('Attempting to trim too much in trimr');  end;  h1 = n1+1;     h2 = n-n2;  z = x(h1:h2,:);  

⌨️ 快捷键说明

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