?? mmpsim.m
字號:
function y=mmpsim(x,tol)%MMPSIM Polynomial Simplification, Strip Leading Zero Terms.% MMPSIM(A) Deletes leading zeros and small coefficients in the% polynomial A(s). Coefficients are considered small if their% magnitude is less than both one and norm(A)*1000*eps.% MMPSIM(A,TOL) uses TOL for its smallness tolerance. % D.C. Hanselman, University of Maine, Orono ME, 04469% 3/4/95% Copyright (c) 1996 by Prentice-Hall, Inc. if nargin<2, tol=norm(x)*1000*eps; endx=x(:).'; % make sure input is a rowi=find(abs(x)<.99&abs(x)<tol); % find insignificant indicesx(i)=zeros(1,length(i)); % set them to zeroi=find(x~=0); % find significant indicesif isempty(i) y=0; % the extreme case: nothing left!else y=x(i(1):length(x)); % start with first significant termend
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -