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

📄 mmppint.m

📁 《精通matlab7》“mastering matlab 7”的代码。
💻 M
字号:
function ppi=mmppint(pp,c)
%MMPPINT Cubic Spline Integral Interpolation.
% PPI=MMPPINT(PP,C) returns the piecewise polynomial vector PPI
% describing the integral of the cubic spline described by
% the piecewise polynomial in PP and having integration constant C.

if prod(size(c))~=1
   error('C Must be a Scalar.')
end
[br,co,npy,nco]=unmkpp(pp);	            % take apart pp
sf=nco:-1:1;								      % scale factors for integration
ico=[co./sf(ones(npy,1),:) zeros(npy,1)];	% integral coefficients
nco=nco+1;									      % integral spline has higher order
ico(1,nco)=c;								      % integration constant
for k=2:npy									      % find constant terms in polynomials
	ico(k,nco)=polyval(ico(k-1,:),br(k)-br(k-1));
end
ppi=mkpp(br,ico);							      % build pp form for integral

⌨️ 快捷键说明

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