faster alternative to scatteredinterpolant

2 次查看(过去 30 天)
Kim
Kim 2014-10-25
评论: Kim 2014-10-27
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.
  1 个评论
Kim
Kim 2014-10-27
I havent been able to figure out a way to speed up the interpolation. Does anyone have a potential solution? Thank you!

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by