demoRBFTypes

PURPOSE ^

demoRBFTypes Shows the shape of the various RBF types available in the toolbox

SYNOPSIS ^

function demoRBFTypes(xLimits, yLimits, stepX, stepY, epsilon)

DESCRIPTION ^

demoRBFTypes Shows the shape of the various RBF types available in the toolbox

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function demoRBFTypes(xLimits, yLimits, stepX, stepY, epsilon)
0002 %demoRBFTypes Shows the shape of the various RBF types available in the toolbox
0003 
0004 if nargin < 1
0005     xLimits = [-1 1];
0006 end
0007 if nargin < 2
0008     yLimits = [-1 1];
0009 end
0010 if nargin < 3
0011     stepX = 0.1;
0012 end
0013 if nargin < 4
0014     stepY = 0.1;
0015 end
0016 if nargin < 5
0017     epsilon = 1;
0018 end
0019 
0020 fprintf('- Plotting all available RBFs in the toolbox.\n');
0021 fprintf('  - Options:\n');
0022 fprintf('    - Sampling X at: [%f:%f:%f]\n', xLimits(1), stepX, xLimits(2));
0023 fprintf('    - Sampling Y at: [%f:%f:%f]\n', yLimits(1), stepY, yLimits(2));
0024 fprintf('    - Epsilon (a.k.a. shape parameter) = %f\n', epsilon);
0025 
0026 % Create the evaluation grid
0027 [xi, yi] = meshgrid(xLimits(1):stepX:xLimits(2), yLimits(1):stepY:yLimits(2));
0028 cx = xLimits(1) + ((xLimits(2)-xLimits(1))/2);
0029 cy = yLimits(1) + ((yLimits(2)-yLimits(1))/2);
0030 
0031 % Compute the evaluation of each RBF
0032 types = {'linear', 'cubic', 'quintic', 'multiquadric', 'thinplate', 'green', 'tensionspline', 'regularizedspline', 'gaussian', 'wendland'};
0033 % types = {'regularizedspline'};
0034 figure;
0035 for i = 1:numel(types)
0036     rbfFun = rbfTypeToFunctor(types{i}, epsilon);
0037     dists = pdist2([cx cy], [xi(:), yi(:)]);
0038     dists = reshape(dists, size(xi));
0039     ziRBF = rbfFun(dists);
0040     plotResult([], [], [], xi, yi, ziRBF, 3, 4, i, [types{i} ' RBF'], 'x', 'y', 'z', false);
0041 end

Generated on Thu 10-Dec-2020 17:34:27 by m2html © 2005