faster alternative to scatteredinterpolant
Show older comments
I have data that looks approximately as follows:
W=[ 1 2 4 5 ; 2 3 4 4; 3 6 7 8 ; 2.5 3 4 5; 4 5 6 7]
Y =[ 1 3 5 7 ; 1 3 5 7; 1 3 5 7; 1 3 5 7; 1 3 5 7];
C = [ 2 3 4 5; 2 4 5 6; 3 4 5 6; 2 3 6 7; 4 5 6 6];
F = scatteredInterpolant([W(:)],[Y(:)],[C(:)]);
C1 = F(3,4)
I need to do this a lot of times, and my code takes hours. This is just a simplified version of the data, just to show you it is non-monotonic and not a grid. Can I sort of manipulate the data into a grid, so that I can use interp2? I tried 'nearest' instead of 'linear', and it is 20% faster, however, I worry about the accuracy. Thank you very much for helping me.
Answers (0)
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!