psim1.m

来自「it is about window function in Matlab. 」· M 代码 · 共 12 行

M
12
字号
function y=psim1(x,tol)
if nargin<2, tol=norm(x)*1000*eps; end
	x=x(:).' ;                       %  make sure input is a row 
	i=find(abs(x)<.99&abs(x)<tol) ;    %  find insignificant indices
	x(i)=zeros(1, length(i)) ;          %  set them to zero
	i=find(x~=0) ;                  %  find significant indices
	if isempty(i)
	     y=0 ;                     %  extreme case: nothing left!
	else
	    y=x(i(1) : length(x)) ;         %  start with first term
	end                           %  and go to end of polynomial

⌨️ 快捷键说明

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