Get Interpolation transfer relation matrix instead of interpolated values
Show older comments
Hey,
I am working on a simulation where I have scattered measurements which I would like to inter- and extrapolate, ideally to any coordinates but to gridded data would also do. Currently I am working with F = scatteredInterpolant().
The point is, that I am always interpolating to the same coordinates. You can set F.Values = newValues; but the computational time is still unreasonably long in my eyes since it should be a simple matrix multiplication.
So what I am looking for is a function which gives me a transformation matrix A from a set of changing variables at fixed coordinates to another set of fixed coordinates.
So the code should look like this:
% Measurement coordinates
meas_x = data.x;
meas_y = data.y;
% Coordinates to transform to
goal_x = linspace(a,b);
goal_y = linspace(a,b);
A = interpolationTransfMatrix(meas_x,meas_y,goal_x,goal_y,'linear');
for i = 1:n
% Apply the same interploation with different values (reshape would be added)
output = A*data.v(:,i);
end
I feel like that is a too-simple problem to not be solved already, but I haven't found a solution so far, maybe I have the wrong keywords.
Thanks for the help!
Accepted Answer
More Answers (1)
Marcus Becker
on 1 Aug 2020
Categories
Find more on Interpolation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!