bilin.m

来自「matlab算法集 matlab算法集」· M 代码 · 共 32 行

M
32
字号
function Z1 = bilin (x,y,Z,x1,y1)
%------------------------------------------------------------------------
% Usage:       Z1 = bilin (x,y,Z,x1,y1)
%
% Description: Perform a bilinear interpolation of the surface f(x,y)
%              evaluated at the points (x1,y1).
%
% Inputs:      x = m by 1 vector containing independent variables
%              y = n by 1 vector containing independent variables
%              Z = m by n matrix containing dependent variables
%
%                  Z(k,j) = f(x(k),y(j))
%
%              x1 = p by 1 vector specifying x evaluation points
%              y1 = q by 1 vector specifying y evaluation points
%
% Outputs:     Z1 = p by q matrix continain interpolated value of 
%                   f(x,y) at (x1,y1).
%
% Notes:       The independent variables in the vectors x and y
%              must be strictly increasing. 
%------------------------------------------------------------------------
  
   chkvec (x,1,'bilin');
   chkvec (y,2,'bilin');
   chkvec (x1,4,'bilin');
   chkvec (y1,5,'bilin');
   
   Q = interp2 (x,y,Z',x1',y1);
   Z1 = Q';
%------------------------------------------------------------------------

⌨️ 快捷键说明

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