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

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

?? griddata.m

?? 各種Matlab數學建模工具箱,方程求根,微積分和微分方程等以及一些數學建模競賽的源程序
?? M
?? 第 1 頁 / 共 2 頁
字號:
function [xi,yi,zi] = griddata(x,y,z,xi,yi,method)
%不規則數據的曲面插值
%ZI=griddata(x,y,z,XI,YI)
%  這里x,y,z均為向量(不必單調)表示數據.
%  XI,YI為網格數據矩陣.griddata采用三角形線性插值.
%ZI=griddata(x,y,z,XI,YI,'cubic') 采用三角形三次插值
%例題  如果數據殘缺不全(x,y,z)
%      | 0   1    2     3    4 
%-----|------------------------
%  2  | *    *   80    82   84 
%  3  | 79   *   61    65   * 
%  4  | 84  84    *     *   86
% 使用
%   x=[2,3,4,0,2,3,0,1,4];
%   y=[2,2,2,3,3,3,4,4,4];
%   z=[80,82,84,79,61,65,84,84,86];
%   subplot(2,1,1);stem3(x,y,z);title('RAW DATA');
%   xi=0:0.1:4;yi=2:0.2:4;
%   [XI,YI]=meshgrid(xi,yi);
%   ZI=griddata(x,y,z,XI,YI,'cubic');
%   subplot(2,1,2);mesh(XI,YI,ZI);title('GRIDDATA');
%
%GRIDDATA Data gridding and surface fitting.
%   ZI = GRIDDATA(X,Y,Z,XI,YI) fits a surface of the form Z = F(X,Y)
%   to the data in the (usually) nonuniformly-spaced vectors (X,Y,Z)
%   GRIDDATA interpolates this surface at the points specified by
%   (XI,YI) to produce ZI.  The surface always goes through the data
%   points.  XI and YI are usually a uniform grid (as produced by
%   MESHGRID) and is where GRIDDATA gets its name.
%
%   XI can be a row vector, in which case it specifies a matrix with
%   constant columns. Similarly, YI can be a column vector and it 
%   specifies a matrix with constant rows. 
%
%   [XI,YI,ZI] = GRIDDATA(X,Y,Z,XI,YI) also returns the XI and YI
%   formed this way (the results of [XI,YI] = MESHGRID(XI,YI)).
%
%   [...] = GRIDDATA(...,'method') where 'method' is one of
%       'linear'    - Triangle-based linear interpolation (default).
%       'cubic'     - Triangle-based cubic interpolation.
%       'nearest'   - Nearest neighbor interpolation.
%       'v4'        - MATLAB 4 griddata method.
%   defines the type of surface fit to the data. The 'cubic' and 'v4'
%   methods produce smooth surfaces while 'linear' and 'nearest' have
%   discontinuities in the first and zero-th derivative respectively.  All
%   the methods except 'v4' are based on a Delaunay triangulation of the
%   data.
%
%   See also INTERP2, DELAUNAY, MESHGRID.

%   Clay M. Thompson 8-21-95
%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 5.22 $  $Date: 1997/11/21 23:40:37 $

error(nargchk(5,6,nargin))

[msg,x,y,z,xi,yi] = xyzchk(x,y,z,xi,yi);
if ~isempty(msg), error(msg); end

if nargin<6, method = 'linear'; end
if ~isstr(method), 
  error('METHOD must be one of ''linear'',''cubic'',''nearest'', or ''v4''.');
end


% Sort x and y so duplicate points can be averaged before passing to delaunay

% Need x,y and z to be column vectors
sz = prod(size(x));
x = reshape(x,sz,1);
y = reshape(y,sz,1);
z = reshape(z,sz,1);
sxyz = sortrows([x y z],[2 1]);
x = sxyz(:,1);
y = sxyz(:,2);
z = sxyz(:,3);
ind = [0; y(2:end) == y(1:end-1) & x(2:end) == x(1:end-1); 0];
if sum(ind) > 0
  warning('Duplicate x-y data points detected: using average of the z values');
  fs = find(ind(1:end-1) == 0 & ind(2:end) == 1);
  fe = find(ind(1:end-1) == 1 & ind(2:end) == 0);
  for i = 1 : length(fs)
    % averaging z values
    z(fe(i)) = mean(z(fs(i):fe(i)));
  end
  x = x(~ind(2:end));
  y = y(~ind(2:end));
  z = z(~ind(2:end));
end

switch lower(method),
  case 'linear'
    zi = linear(x,y,z,xi,yi);
  case 'cubic'
    zi = cubic(x,y,z,xi,yi);
  case 'nearest'
    zi = nearest(x,y,z,xi,yi);
  case {'invdist','v4'}
    zi = gdatav4(x,y,z,xi,yi);
  otherwise
    error('Unknown method.');
end
  
if nargout<=1, xi = zi; end


%------------------------------------------------------------
function zi = linear(x,y,z,xi,yi)
%LINEAR Triangle-based linear interpolation

%   Reference: David F. Watson, "Contouring: A guide
%   to the analysis and display of spacial data", Pergamon, 1994.

siz = size(xi);
xi = xi(:); yi = yi(:); % Treat these as columns
x = x(:); y = y(:); % Treat these as columns

% Triangularize the data
tri = delaunay(x,y,'sorted');
if isempty(tri),
  warning('Data cannot be triangulated.');
  zi = repmat(NaN,size(xi));
  return
end

% Find the nearest triangle (t)
t = tsearch(x,y,tri,xi,yi);

% Only keep the relevant triangles.
out = find(isnan(t));
if ~isempty(out), t(out) = ones(size(out)); end
tri = tri(t,:);

% Compute Barycentric coordinates (w).  P. 78 in Watson.
del = (x(tri(:,2))-x(tri(:,1))) .* (y(tri(:,3))-y(tri(:,1))) - ...
      (x(tri(:,3))-x(tri(:,1))) .* (y(tri(:,2))-y(tri(:,1)));
w(:,3) = ((x(tri(:,1))-xi).*(y(tri(:,2))-yi) - ...
          (x(tri(:,2))-xi).*(y(tri(:,1))-yi)) ./ del;
w(:,2) = ((x(tri(:,3))-xi).*(y(tri(:,1))-yi) - ...
          (x(tri(:,1))-xi).*(y(tri(:,3))-yi)) ./ del;
w(:,1) = ((x(tri(:,2))-xi).*(y(tri(:,3))-yi) - ...
          (x(tri(:,3))-xi).*(y(tri(:,2))-yi)) ./ del;
w(out,:) = zeros(length(out),3);

z = z(:).'; % Treat z as a row so that code below involving
            % z(tri) works even when tri is 1-by-3.
zi = sum(z(tri) .* w,2);

zi = reshape(zi,siz);

if ~isempty(out), zi(out) = NaN; end
%------------------------------------------------------------

%------------------------------------------------------------
function zi = cubic(x,y,z,xi,yi)
%TRIANGLE Triangle-based cubic interpolation

%   Reference: T. Y. Yang, "Finite Element Structural Analysis",
%   Prentice Hall, 1986.  pp. 446-449.
%
%   Reference: David F. Watson, "Contouring: A guide
%   to the analysis and display of spacial data", Pergamon, 1994.

siz = size(xi);
xi = xi(:); yi = yi(:); % Treat these as columns
x = x(:); y = y(:); z = z(:); % Treat these as columns

% Triangularize the data
tri = delaunay(x,y,'sorted');
if isempty(tri), 
  warning('Data cannot be triangulated.');
  zi = repmat(NaN,size(xi));
  return
end

%
% Estimate the gradient as the average the triangle slopes connected
% to each vertex
%
t1 = [x(tri(:,1)) y(tri(:,1)) z(tri(:,1))];
t2 = [x(tri(:,2)) y(tri(:,2)) z(tri(:,2))];
t3 = [x(tri(:,3)) y(tri(:,3)) z(tri(:,3))];
Area = ((x(tri(:,2))-x(tri(:,1))) .* (y(tri(:,3))-y(tri(:,1))) - ...
       (x(tri(:,3))-x(tri(:,1))) .* (y(tri(:,2))-y(tri(:,1))))/2;
nv = cross((t3-t1).',(t2-t1).').';

% Normalize normals
nv = nv ./ repmat(nv(:,3),1,3);

% Sparse matrix is non-zero if the triangle specified the row
% index is connected to the point specified by the column index.
% Gradient estimate is area weighted average of triangles 
% around a datum.
m = size(tri,1);
n = length(x);
i = repmat((1:m)',1,3);
T = sparse(i,tri,repmat(-nv(1:m,1).*Area,1,3),m,n);
A = sparse(i,tri,repmat(Area,1,3),m,n);
s = full(sum(A));
gx = (full(sum(T))./(s + (s==0)))';
T = sparse(i,tri,repmat(-nv(1:m,2).*Area,1,3),m,n);
gy = (full(sum(T))./(s + (s==0)))';

% Compute triangle areas and side lengths
i1 = [1 2 3]; i2 = [2 3 1]; i3 = [3 1 2];
xx = x(tri);
yy = y(tri);
zz = z(tri);
gx = gx(tri);
gy = gy(tri);
len = sqrt((xx(:,i3)-xx(:,i2)).^2 + (yy(:,i3)-yy(:,i2)).^2);

% Compute average normal slope
gn = ((gx(:,i2)+gx(:,i3)).*(yy(:,i2)-yy(:,i3)) - ...
      (gy(:,i2)+gy(:,i3)).*(xx(:,i2)-xx(:,i3)))/2./len;

% Compute triangle normal edge gradient at the center of each side (Wn)
Area = repmat(Area,1,3);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩在线免费视频| 99久久er热在这里只有精品66| 欧美男女性生活在线直播观看| 亚洲一区二三区| 欧美日韩国产高清一区二区| 午夜欧美2019年伦理| 欧美精品第1页| 久久97超碰国产精品超碰| 精品国产一区二区在线观看| 国产精品456露脸| 136国产福利精品导航| 欧美色视频在线观看| 日本免费新一区视频| 久久九九久精品国产免费直播| 成人黄页在线观看| 亚洲成av人片| 亚洲精品一区二区三区99| 成人性生交大合| 亚洲一区二区三区中文字幕| 日韩视频一区二区在线观看| 国产精品一区二区视频| 亚洲激情六月丁香| 日韩一区二区三区免费看| 风间由美性色一区二区三区| 亚洲中国最大av网站| 欧美电影免费观看完整版| 成人黄动漫网站免费app| 亚洲成精国产精品女| 久久众筹精品私拍模特| 欧美性xxxxxx少妇| 国产综合色产在线精品| 亚洲猫色日本管| 欧美岛国在线观看| 在线精品视频一区二区三四| 久久爱另类一区二区小说| 亚洲黄网站在线观看| 精品国产一二三区| 在线免费观看视频一区| 国产主播一区二区| 亚洲一区二区在线视频| 国产欧美精品一区二区色综合| 欧美片网站yy| av成人老司机| 国产一区亚洲一区| 亚洲chinese男男1069| 中文字幕av一区二区三区免费看| 欧美区一区二区三区| 97国产精品videossex| 国产一区视频网站| 秋霞影院一区二区| 亚洲在线视频免费观看| 国产精品久久二区二区| 久久久九九九九| 日韩欧美综合一区| 欧美日韩国产在线观看| 99国产精品99久久久久久| 国产九色精品成人porny | 午夜精彩视频在线观看不卡| 欧美经典三级视频一区二区三区| 欧美一区二区三区影视| 在线亚洲一区二区| eeuss鲁片一区二区三区在线看| 国产乱码精品一区二区三区五月婷| 亚洲第一精品在线| 亚洲一区二区三区视频在线播放| 国产精品乱码久久久久久| 国产亚洲欧美一区在线观看| 欧美一二三区在线观看| 制服丝袜亚洲网站| 欧洲一区在线观看| 色天天综合色天天久久| 91视频免费观看| 91免费在线看| 色中色一区二区| 色婷婷久久久综合中文字幕| 99久久精品一区| 91丨九色porny丨蝌蚪| 成人黄色国产精品网站大全在线免费观看| 国产真实乱偷精品视频免| 九一久久久久久| 国产精品一区二区三区四区| 国产在线观看一区二区| 国产自产高清不卡| 国产suv精品一区二区三区| 成人午夜视频在线观看| 99久久久无码国产精品| 94-欧美-setu| 欧美视频一区二区| 欧美一区二区女人| 精品日产卡一卡二卡麻豆| 欧美成人女星排名| 国产亚洲精久久久久久| 国产精品久久久久久久浪潮网站 | 国产精品麻豆欧美日韩ww| 国产精品你懂的| 亚洲精品国产a久久久久久| 自拍偷拍国产亚洲| 亚洲成人免费观看| 韩国v欧美v日本v亚洲v| 国产精品影视在线观看| av电影天堂一区二区在线观看| 91精品办公室少妇高潮对白| 欧美日韩成人在线一区| 精品盗摄一区二区三区| 欧美国产一区二区在线观看| 亚洲女女做受ⅹxx高潮| 日韩精品欧美成人高清一区二区| 韩国欧美一区二区| 91网上在线视频| 欧美一区二区三区喷汁尤物| 欧美国产日韩亚洲一区| 一级精品视频在线观看宜春院| 亚洲成a天堂v人片| 国产一区不卡精品| 日本伦理一区二区| 欧美精品一区二区三区蜜臀| 中文字幕日本乱码精品影院| 亚洲午夜久久久久中文字幕久| 蜜桃精品视频在线观看| 波多野结衣欧美| 日韩欧美国产一区在线观看| 国产精品美女一区二区在线观看| 五月综合激情婷婷六月色窝| 成人精品小蝌蚪| 777欧美精品| 亚洲欧美综合另类在线卡通| 蜜臀av一区二区三区| 99免费精品视频| 精品黑人一区二区三区久久| 一区二区高清在线| 成人一级视频在线观看| 337p亚洲精品色噜噜狠狠| 中文字幕亚洲在| 国产最新精品免费| 欧美日韩卡一卡二| 亚洲老妇xxxxxx| 成人高清视频在线| 精品国产免费人成在线观看| 亚洲午夜免费福利视频| 成人毛片老司机大片| 欧美精品一区二区三区蜜桃| 亚洲国产精品久久久久婷婷884| 国产91综合一区在线观看| 欧美喷潮久久久xxxxx| 亚洲欧美激情一区二区| 国产在线一区二区综合免费视频| 欧美三级日本三级少妇99| 国产精品成人免费| 高清日韩电视剧大全免费| 日韩免费高清av| 无码av中文一区二区三区桃花岛| 色综合久久久久综合| 国产精品入口麻豆九色| 国产一区二区三区国产| 日韩欧美在线影院| 日本欧美一区二区三区| 欧美精品aⅴ在线视频| 一个色在线综合| 在线视频国内一区二区| 自拍偷自拍亚洲精品播放| eeuss鲁一区二区三区| 国产精品久久网站| www.欧美.com| 欧美高清一级片在线观看| 国产乱子伦一区二区三区国色天香| 欧美一区二区三区四区五区| 日本v片在线高清不卡在线观看| 欧美日韩国产bt| 丝袜脚交一区二区| 欧美一级专区免费大片| 三级成人在线视频| 91精品国产综合久久久久久漫画| 天天综合网天天综合色 | 欧美理论电影在线| 日韩精品视频网站| 日韩免费高清av| 国产精品综合网| 国产精品久久久久久久蜜臀| 91亚洲资源网| 亚洲资源在线观看| 91精品国产一区二区人妖| 久久精品国产澳门| 久久久久久免费毛片精品| 成人sese在线| 亚洲国产wwwccc36天堂| 日韩一区二区影院| 国产精品一品视频| 亚洲柠檬福利资源导航| 欧美日本国产一区| 国产一区激情在线| 亚洲人吸女人奶水| 欧美日韩视频专区在线播放| 美女一区二区三区| 中文av一区二区| 欧美亚洲国产bt| 精品一区二区av| 日韩一区中文字幕| 欧美精品丝袜久久久中文字幕| 国内精品久久久久影院色| 中文字幕在线观看一区二区|