matRad_interp3

Purpose ^

interpolates 3-D data (table lookup)

Synopsis ^

function y = matRad_interp3(xi,yi,zi,x,xq,yq,zq,mode,extrapVal)

Description ^

 interpolates 3-D data (table lookup) 

 call
   y = matRad_interp3(xi,yi,zi,x,xq,yq,zy)
   y = matRad_interp3(xi,yi,zi,x,xq,yq,zy,mode)
   y = matRad_interp3(xi,yi,zi,x,xq,yq,zy,mode,extrapVal)

 input
   xi,yi,zi:   grid vectors 
   x:          data
   xq,yq,zq:   coordinates of quer points as a grid
   mode:       optional interpolation mode (default linear)
   extrapVal:  (optional) value for extrapolation
    
 output
   y: interpolated data   

   References
     -

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 Copyright 2019 the matRad development team. 
 
 This file is part of the matRad project. It is subject to the license 
 terms in the LICENSE file found in the top-level directory of this 
 distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part 
 of the matRad project, including this file, may be copied, modified, 
 propagated, or distributed except according to the terms contained in the 
 LICENSE file.

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Cross-reference information ^

This function calls: This function is called by:

Source code ^

0001 function y = matRad_interp3(xi,yi,zi,x,xq,yq,zq,mode,extrapVal)
0002 % interpolates 3-D data (table lookup)
0003 %
0004 % call
0005 %   y = matRad_interp3(xi,yi,zi,x,xq,yq,zy)
0006 %   y = matRad_interp3(xi,yi,zi,x,xq,yq,zy,mode)
0007 %   y = matRad_interp3(xi,yi,zi,x,xq,yq,zy,mode,extrapVal)
0008 %
0009 % input
0010 %   xi,yi,zi:   grid vectors
0011 %   x:          data
0012 %   xq,yq,zq:   coordinates of quer points as a grid
0013 %   mode:       optional interpolation mode (default linear)
0014 %   extrapVal:  (optional) value for extrapolation
0015 %
0016 % output
0017 %   y: interpolated data
0018 %
0019 %   References
0020 %     -
0021 %
0022 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0023 %
0024 % Copyright 2019 the matRad development team.
0025 %
0026 % This file is part of the matRad project. It is subject to the license
0027 % terms in the LICENSE file found in the top-level directory of this
0028 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
0029 % of the matRad project, including this file, may be copied, modified,
0030 % propagated, or distributed except according to the terms contained in the
0031 % LICENSE file.
0032 %
0033 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0034 
0035 
0036 [env, ~] = matRad_getEnvironment();
0037 
0038 
0039 if nargin < 8
0040     mode = 'linear';
0041 end
0042 
0043 if nargin < 9
0044     extrapVal = NaN;
0045 end
0046 
0047 switch env
0048     case 'MATLAB'
0049         y = interp3(xi,yi,zi,x,xq,yq,zq,mode,extrapVal);
0050     case 'OCTAVE'
0051         [xqMesh,yqMesh,zqMesh] = meshgrid(xq,yq,zq);
0052         y = interp3(xi,yi,zi,x,xqMesh,yqMesh,zqMesh,mode,extrapVal);
0053 end
0054

| Generated by m2html © 2005