These routines are very useful. Would like to read more on the mathematical foundation of these routines. Can you recommend reading beyond the basic least square splines references?
Also, I made the following correction concerning handling of weights...
% were there any NaN or inf elements in the data?
k = isnan(x) | isnan(y) | isinf(x) | isinf(y);
if any(k)
% drop them from the analysis
x(k) = [];
y(k) = [];
prescription.Weights(k) = []; % ALSO drop corresponding weights, May 2011
n = length(x);
end
% if weights or errorbars were set, verify the sizes of these
% parameters, compared to the number of data points.
11 Dec 2010
Google Earth
Example of using Matlab to control Google Earth via the Google Earth API.
Author: Richard Gueler
Line 94: m = round((0:(N2-1))/alpha) - (0:(N2-1));
You're essentially doing a nearest neighbor interpolation. You've upsampled the data by your factor of 'r,' but I believe that it's perfectly equivalent to running the command resample(X,r,r/alpha,0). Taking this into account, resampleX loses its speed advantage.
I do appreciate the fact that to run resample, r must be chosen to make r/alpha an integer. An exotic alpha could necessitate an enormous r to work in resample.