亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? csape.m

?? 各種Matlab數學建模工具箱,方程求根,微積分和微分方程等以及一些數學建模競賽的源程序
?? M
字號:
function pp = csape(x,y,conds,valconds)
%pp=csape(x,y,'變界類型','邊界值'),生成各種邊界條件的三次樣條插值. 其中,邊界類型可為:'complete',給定邊界一階導數.
%             'not-a-knot',非扭結條件,不用給邊界值.
%             'periodic',周期性邊界條件,不用給邊界值.
%             'second',給定邊界二階導數.  
%             'variational',自然樣條(邊界二階導數為0)
%  但與spline不同的是,csape的輸出是一個結構,可直接用fnplt(pp)畫出它的圖.
%
%CSAPE Cubic spline interpolation with various end-conditions.
%
%   PP  = CSAPE(X,Y[,CONDS[,VALCONDS]])
%
%   returns the cubic spline interpolant (in ppform) to the given
%   data (X,Y) using the specified end-conditions.
%
%   CONDS may be a *string* whose first character matches one of the
%   following: 'complete' or 'clamped', 'not-a-knot', 'periodic',
%   'second', 'variational', with the following meanings:
%
%   'complete'    : match endslopes (as given in VALCONDS, with
%                   default as under *default*)
%   'not-a-knot'  : make spline C^3 across first and last interior
%                   breakpoint (ignoring VALCONDS if given)
%   'periodic'    : match first and second derivatives at first data
%                   point with those at last data point
%                   (ignoring VALCONDS if given)
%   'second'      : match end second derivatives (as given in VALCONDS,
%                   with default [0 0], i.e., as in variational)
%   'variational' : set end second derivatives equal to zero
%                   (ignoring VALCONDS if given)
%   The *default* : match endslopes to the slope of the cubic which
%                   matches the first four data at the respective end.
%
%   By giving CONDS as a 1-by-2 matrix instead, it is possible to
%   specify *different* conditions at the two endpoints, namely
%   CONDS(i) with value VALCONDS(:,i), with i=1 (i=2) referring to the
%   left (right) endpoint.
%
%   CONDS(i)=j  means that the j-th derivative is being specified to
%   be VALCONDS(:,i) , j=1,2.  CONDS(1)=0=CONDS(2)  means periodic end
%   conditions.
%
%   If CONDS(i) is not specified or is different from 0, 1 or 2, then
%   the default value for CONDS(i) is  1  and the default value of
%   VALCONDS(:,i) is taken.  If VALCONDS is not specified, then the
%   default value for VALCONDS(:,i) is taken to be
%
%    deriv. of cubic interpolant to nearest four points, if   CONDS(i)=1;
%                     0                                  if   CONDS(i)=2.
%
%   It is possible (and, in the case of gridded data required) to specify
%   VALCONDS as part of Y. Specifically, if size(Y) == [d,ny] and ny ==
%   length(X)+2, then VALCONDS is taken to be Y(:,[1 end]), and Y(:,i+1)
%   is matched at X(i), i=1:length(X).
%
%   It is also possible to handle gridded data, by having X be a cell array
%   containing m univariate meshes and, correspondingly, having Y be an
%   m-dimensional array (or an m+1-dimensional array if the function is to be
%   vector-valued). Correspondingly, CONDS is a cell array with m entries, but
%   the information normally specified by VALCONDS is now expected to be part
%   of Y. 
%
%   For example,
%
%      fnplt(csape( [0:4], [1 0 -1 0 1;0 1 0 -1 0], 'periodic')), axis equal
%
%   plots a circle, while
%
%      pp = csape( [0:4]*(pi/2), [0 1 0 -1 0], [1 2], [1 0] );
%
%   gives a good approximation to the sine function on the interval [0 .. 2*pi]
%   (matching its slope at 0 and its second derivative at 2*pi in addition 
%   to its value at 0:pi/2:2*pi).
%
%   As a multivariate vector-valued example, here is a sphere, done as a 
%   parametric bicubic spline, using prescribed slopes in one direction and
%   periodic side conditions in the other:
%
%      x = 0:4; y=-2:2; s2 = 1/sqrt(2);
%      clear v
%      v(3,:,:) = [0 1 s2 0 -s2 -1 0].'*[1 1 1 1 1];
%      v(2,:,:) = [1 0 s2 1 s2 0 -1].'*[0 1 0 -1 0];
%      v(1,:,:) = [1 0 s2 1 s2 0 -1].'*[1 0 -1 0 1];
%      sph = csape({x,y},v,{'clamped','periodic'});
%      values = fnval(sph,{0:.1:4,-2:.1:2});
%      surf(squeeze(values(1,:,:)),squeeze(values(2,:,:)),squeeze(values(3,:,:)))
%      % the previous two lines could have been replaced by: fnplt(sph) 
%      axis equal, axis off
%
%   See also CSAPI, SPAPI, SPLINE.

%   Carl de Boor 3 dec 90
%   cb : February 22, 1991 (added comments)
%   cb : 12 April 1992 (added periodic case and comments)
%   cb : 19 February 1994 (convert to sparse matrix use
%                                            and to vector-valued ordinates)
%   cb : 9 may '95 (use .' instead of ')
%   cb : 24 nov '95 (permit CONDS to be string; rewrite the help)
%   cb : 03 nov '96 (handle warning about empties of incorrect size when n=2)
%   cb : 29mar97 (correct help, re `periodic')
%   cb : 06oct97 (improve help, add examples)
%   cb : 25oct97 (permit gridded data, and the specification of VALCONDS as
%                 part of Y; add example of a sphere done as a parametric
%                 bicubic spline )
%   Copyright (c) 1987-98 by C. de Boor and The MathWorks, Inc.
%   $Revision: 1.6 $

%     Generate the cubic spline interpolant in pp form.

if nargin<3, conds = [1 1]; end

if iscell(x)       % we are dealing with gridded data

   m = length(x);
   sizey = size(y);
   switch length(sizey)
     case m  % grid values of a scalar-valued function
        sizey = [1 sizey]; y = reshape(y, sizey); 
     case m+1
     otherwise
        error(['If X is a cell-array of length m, then Y must be an ', ...
               'm- or (m+1)-dimensional array.'])
   end
   if ~iscell(conds), conds = num2cell(repmat(conds,m,1),2); end
   
   v = y; sizev = sizey;
   for i=m:-1:1   % carry out coordinatewise interpolation
      [b,v,l,k] = ppbrk(csape1(x{i}, ...
                   reshape(v,prod(sizev(1:m)),sizev(m+1)),conds{i}));
      breaks{i} = b;
      sizev(m+1) = l*k; v = reshape(v,sizev);
      if m>1
         v = permute(v,[1,m+1,2:m]); sizev(2:m+1) = sizev([m+1,2:m]);
      end
   end
   % At this point, V contains the tensor-product pp coefficients;
   % It remains to make up the formal description:
   pp = ppmak(breaks, v);

else         % we are dealing with univariate data

   if nargin<4
      pp = csape1(x,y,conds);
   else
      pp = csape1(x,y,conds,valconds);
   end
end

function pp = csape1(x,y,conds,valconds)
%     Generate the cubic spline interpolant in pp form.

n = length(x); [xi,ind] = sort(x); xi = xi(:);
pp = [];
if n<2, error('There should be at least two data points.'), end

if all(diff(xi))==0, error('The data abscissae should be distinct.'), end

[yd,yn] = size(y); % if y happens to be a one-column matrix, change it to
                   % the expected one-row matrix.
if yn==1, yn=yd; y=reshape(y,1,yn); yd=1; end

switch yn
   case n
   case n+2, valconds = y(:,[1 end]); y(:,[1 end]) = [];
   otherwise
      error('Number of data sites and data values should match.')
end

yi=y(:,ind).'; dd = ones(1,yd);

valsnotgiven=0;
if ~exist('valconds'), valsnotgiven=1;  valconds = zeros(yd,2); end
if isstr(conds)
   if     conds(1)=='c', conds = [1 1];
   elseif conds(1)=='n', pp = csapi(x,y); return
   elseif conds(1)=='p', conds = [0 0];
   elseif conds(1)=='s', conds = [2 2];
   elseif conds(1)=='v', conds = [2 2]; valconds = zeros(yd,2);
   else, error(['Unknown end condition *',conds,'* specified.'])
   end
end

   % set up the linear system for solving for the slopes at XI.
dx = diff(xi); divdif = diff(yi)./dx(:,dd);
c = spdiags([ [dx(2:n-1,1);0;0] ...
            2*[0;dx(2:n-1,1)+dx(1:n-2,1);0] ...
              [0;0;dx(1:n-2,1)] ], [-1 0 1], n, n);
b = zeros(n,yd);
b(2:n-1,:)=3*(dx(2:n-1,dd).*divdif(1:n-2,:)+dx(1:n-2,dd).*divdif(2:n-1,:));
if ~any(conds)
   c(1,1)=1; c(1,n)=-1;
elseif conds(1)==2
   c(1,1:2)=[2 1]; b(1,:)=3*divdif(1,:)-(dx(1)/2)*valconds(:,1).';
else
   c(1,1:2) = [1 0]; b(1,:) = valconds(:,1).';
   if (valsnotgiven|conds(1)~=1)  % if endslope was not supplied,
                              % get it by local interpolation
     b(1,:)=divdif(1,:);
     if n>2, ddf=(divdif(2,:)-divdif(1,:))/(xi(3)-xi(1));
       b(1,:) = b(1,:)-ddf*dx(1); end
     if n>3, ddf2=(divdif(3,:)-divdif(2,:))/(xi(4)-xi(2));
       b(1,:)=b(1,:)+(ddf2-ddf)*(dx(1)*(xi(3)-xi(1)))/(xi(4)-xi(1)); end
   end
end
if ~any(conds)
   c(n,1:2)=dx(n-1)*[2 1]; c(n,n-1:n)= c(n,n-1:n)+dx(1)*[1 2];
   b(n,:) = 3*(dx(n-1)*divdif(1,:) + dx(1)*divdif(n-1,:));
elseif conds(2)==2
   c(n,n-1:n)=[1 2]; b(n,:)=3*divdif(n-1,:)+(dx(n-1)/2)*valconds(:,2).';
else
   c(n,n-1:n) = [0 1]; b(n,:) = valconds(:,2).';
   if (valsnotgiven|conds(2)~=1)  % if endslope was not supplied,
                              % get it by local interpolation
      b(n,:)=divdif(n-1,:);
      if n>2, ddf=(divdif(n-1,:)-divdif(n-2,:))/(xi(n)-xi(n-2));
        b(n,:) = b(n,:)+ddf*dx(n-1); end
      if n>3, ddf2=(divdif(n-2,:)-divdif(n-3,:))/(xi(n-1)-xi(n-3));
        b(n,:)=b(n,:)+(ddf-ddf2)*(dx(n-1)*(xi(n)-xi(n-2)))/(xi(n)-xi(n-3));
      end
   end
end

  % solve for the slopes ..  (protect current spparms setting)
mmdflag = spparms('autommd');
spparms('autommd',0); % suppress pivoting
s=c\b;
spparms('autommd',mmdflag);

  %                          .. and convert to pp form
c4 = (s(1:n-1,:)+s(2:n,:)-2*divdif(1:n-1,:))./dx(:,dd);
c3 = (divdif(1:n-1,:)-s(1:n-1,:))./dx(:,dd) - c4;
pp = ppmak(xi.', ...
 reshape([(c4./dx(:,dd)).' c3.' s(1:n-1,:).' yi(1:n-1,:).'],(n-1)*yd,4),yd);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品在线一区二区| 亚洲一级不卡视频| 亚洲精品视频在线看| 青青草国产成人99久久| 色综合亚洲欧洲| 日韩精品在线网站| 日韩精品一级中文字幕精品视频免费观看| 国产一区二区三区最好精华液| 欧美色男人天堂| 国产精品欧美久久久久一区二区| 日本午夜一本久久久综合| 99综合电影在线视频| 久久亚洲精精品中文字幕早川悠里| 亚洲第一久久影院| 色久综合一二码| 中文字幕在线观看一区二区| 黑人精品欧美一区二区蜜桃| 欧美丰满一区二区免费视频| 亚洲一区二区三区三| gogogo免费视频观看亚洲一| 国产亚洲一本大道中文在线| 极品美女销魂一区二区三区 | 成人成人成人在线视频| 在线播放中文字幕一区| 亚洲国产wwwccc36天堂| 欧洲精品视频在线观看| 亚洲精品中文字幕在线观看| 91免费看片在线观看| 中文字幕在线一区免费| yourporn久久国产精品| 中文字幕在线观看不卡视频| 99久久99久久久精品齐齐| 中文字幕一区三区| 色综合久久中文字幕| 一区二区三区产品免费精品久久75| 91丨porny丨中文| 一区二区欧美国产| 欧美日韩国产大片| 免费不卡在线观看| 久久久电影一区二区三区| 成人午夜激情影院| 18成人在线观看| 欧洲一区在线电影| 日韩高清在线电影| 久久综合狠狠综合久久激情| 国产精品123区| 亚洲欧美另类图片小说| 欧美亚洲精品一区| 久久se这里有精品| 国产精品亲子乱子伦xxxx裸| 91福利在线看| 奇米一区二区三区| 欧美高清在线一区二区| 色婷婷精品久久二区二区蜜臀av | 91浏览器在线视频| 亚洲精品国产精品乱码不99| 欧美日韩精品是欧美日韩精品| 五月婷婷久久丁香| 国产色产综合产在线视频| 91丝袜呻吟高潮美腿白嫩在线观看| 亚洲午夜三级在线| 久久色.com| 色妞www精品视频| 免费在线观看精品| 亚洲三级小视频| 日韩精品中文字幕在线一区| 99热国产精品| 美国十次综合导航| 亚洲激情男女视频| 久久奇米777| 欧美日韩国产综合久久| 国产盗摄女厕一区二区三区| 亚洲一区欧美一区| 日本一区二区免费在线观看视频| 欧美日韩免费高清一区色橹橹 | 日本精品视频一区二区三区| 麻豆91精品视频| 一区二区三区精品| 欧美—级在线免费片| 日韩一本二本av| 色综合久久久网| 粉嫩av一区二区三区| 美女精品自拍一二三四| 亚洲电影一级片| 亚洲人成在线播放网站岛国 | 国产很黄免费观看久久| 午夜影院久久久| 又紧又大又爽精品一区二区| 国产亚洲欧洲997久久综合| 欧美一卡在线观看| 色琪琪一区二区三区亚洲区| 成人免费毛片aaaaa**| 久久99国产乱子伦精品免费| 香蕉成人啪国产精品视频综合网| 一区精品在线播放| 久久久久九九视频| 精品久久国产字幕高潮| 欧美夫妻性生活| 欧美天天综合网| 欧美怡红院视频| 一本色道久久综合亚洲91| 成人av综合在线| 成人av网址在线观看| 国产高清亚洲一区| 国产伦精品一区二区三区免费迷 | 国产精品家庭影院| 国产精品婷婷午夜在线观看| 久久久精品中文字幕麻豆发布| 日韩欧美一区在线观看| 日韩一级高清毛片| 精品日韩在线观看| 久久一区二区视频| 国产日产欧产精品推荐色| 久久精品人人做人人爽人人 | 欧美一区二区女人| 日韩一级视频免费观看在线| 欧美一级xxx| 精品国产乱码久久久久久图片| 日韩欧美二区三区| 精品国产伦一区二区三区观看方式 | 欧美三级资源在线| 欧美日韩一区二区三区在线| 欧美人与禽zozo性伦| 日韩一区二区精品在线观看| 日韩欧美综合在线| 久久久国产一区二区三区四区小说 | 91丝袜美女网| 欧美日韩一区视频| 欧美成人video| 中文文精品字幕一区二区| 国产精品入口麻豆原神| 亚洲卡通欧美制服中文| 青青草91视频| 丁香网亚洲国际| 欧美亚洲一区三区| 精品久久久久99| 最新日韩在线视频| 亚洲二区在线视频| 久久精工是国产品牌吗| 成人免费毛片app| 欧美性大战xxxxx久久久| 日韩欧美国产1| 亚洲三级在线看| 美女在线视频一区| 成人av电影免费观看| 欧美疯狂做受xxxx富婆| 国产欧美精品一区二区三区四区 | 欧美综合天天夜夜久久| 欧美一卡二卡在线观看| 国产精品看片你懂得| 午夜视频一区在线观看| 国产成人啪午夜精品网站男同| 99国产精品久久久久久久久久| 欧美精品日日鲁夜夜添| 日本一区二区电影| 日本成人在线不卡视频| 从欧美一区二区三区| 欧美日本国产视频| 欧美国产激情一区二区三区蜜月| 午夜一区二区三区视频| 国产成人一区在线| 欧美一区二区三区电影| 一区视频在线播放| 精品亚洲欧美一区| 欧美午夜精品久久久久久超碰| 久久久青草青青国产亚洲免观| 亚洲黄一区二区三区| 国产xxx精品视频大全| 日韩午夜激情av| 夜夜精品视频一区二区| 成人一级视频在线观看| 欧美白人最猛性xxxxx69交| 一区二区三区加勒比av| 国产91精品露脸国语对白| 宅男在线国产精品| 亚洲va欧美va人人爽午夜| 成人午夜视频福利| 国产亚洲va综合人人澡精品| 丝袜亚洲另类丝袜在线| 在线观看亚洲精品| 综合激情成人伊人| 国产成人亚洲精品狼色在线 | 国产日韩精品一区| 精品一区二区影视| 日韩午夜激情电影| 日韩电影在线观看电影| 一本一道综合狠狠老| 中文字幕不卡在线播放| 国产91精品一区二区| 精品国产不卡一区二区三区| 婷婷成人综合网| 51久久夜色精品国产麻豆| 亚洲国产一区二区在线播放| 91官网在线观看| 亚洲宅男天堂在线观看无病毒| 99麻豆久久久国产精品免费| 久久精品视频在线看| 国产成人亚洲综合a∨婷婷图片 | 亚洲综合激情另类小说区| 99国产精品国产精品久久|