0001 function demoQuadTreePURBFInterpolants(dataId)
0002
0003
0004
0005 if nargin < 1 || isempty(dataId)
0006 dataId = 'seamount';
0007 end
0008
0009
0010 [x, y, z, xi, yi, zt, demoOptions] = getSampleDataset(dataId);
0011
0012
0013 figure;
0014 xLabel = demoOptions.Plot.XLabel;
0015 yLabel = demoOptions.Plot.YLabel;
0016 zLabel = demoOptions.Plot.ZLabel;
0017 axisEqual = demoOptions.Plot.AxisEqual;
0018 spNumRows = 3;
0019 spNumCols = 4;
0020 if ~isempty(zt)
0021 plotResult([], [], [], xi, yi, zt, spNumRows, spNumCols, 1, 'Original Function', xLabel, yLabel, zLabel, axisEqual);
0022 else
0023
0024 end
0025
0026
0027 types = {'linear', 'cubic', 'quintic', 'multiquadric', 'thinplate', 'green', 'tensionspline', 'regularizedspline', 'gaussian', 'wendland'};
0028
0029 spInd = 2;
0030 for i = 1:numel(types)
0031 fprintf('- Interpolating using the Radial Basis Function Interpolant (%s kernel)...', types{i});
0032 tic;
0033 rbfInterp = QuadTreePURBFInterpolant(x, y, z, 'MinPointsInCell', demoOptions.PURBF.MinPointsInCell, ...
0034 'MinCellSizePercent', demoOptions.PURBF.MinCellSizePercent, ...
0035 'Overlap', demoOptions.PURBF.Overlap, ...
0036 'Domain', demoOptions.PURBF.Domain, ...
0037 'DistanceType', demoOptions.DistanceType, ...
0038 'PolynomialDegree', demoOptions.RBF.(types{i}).PolynomialDegree, ...
0039 'RBF', types{i}, ...
0040 'RBFEpsilon', demoOptions.RBF.(types{i}).RBFEpsilon, ...
0041 'Regularization', demoOptions.RBF.(types{i}).Regularization);
0042
0043 if i == 1
0044
0045 subplot(spNumRows, spNumCols, spInd);
0046 title('Input Samples + Quad Tree decomposition');
0047 rbfInterp.plot(false);
0048 spInd = spInd+1;
0049 end
0050
0051 ziRBF = rbfInterp.interpolate(xi, yi);
0052 t = toc;
0053 fprintf(' done (%f seconds)\n', t);
0054 plotResult(x, y, z, xi, yi, ziRBF, spNumRows, spNumCols, spInd, [types{i} ' RBF Interpolant'], xLabel, yLabel, zLabel, axisEqual);
0055 spInd = spInd+1;
0056 end
0057 end