intarpulation on a sin wall
2 次查看(过去 30 天)
显示 更早的评论
I have a large data set and want to interpolate it; I am using this code to do so. Is there bater way or method to do so? My wave amplitude is 3.6mm, and length is 28.8 mm, which is very short. Any idea? i see some people segest Karnels intepulation? (i dont see a point to uplode any data it really simpal 2D data of velocity in a wavy tunnel, just want any good idea of intarpulations). i have large amount of waves and measurments so i need to be fast as well.
F_u = scatteredInterpolant(section_x(:), section_y(:), section_u(:), 'linear', 'none');
interp_u = F_u(interp_x, interp_y);
F_v = scatteredInterpolant(section_x(:), section_y(:), section_v(:), 'linear', 'none');
interp_v = F_v(interp_x, interp_y);
F_T = scatteredInterpolant(section_x(:), section_y(:), section_T(:), 'linear', 'none');
interp_T = F_T(interp_x, interp_y);
F_P = scatteredInterpolant(section_x(:), section_y(:), section_P(:), 'linear', 'none');
interp_P = F_P(interp_x, interp_y);
F_Tw = scatteredInterpolant(section_x(:), section_y(:), section_Tw(:), 'linear', 'none');
interp_Tw = F_Tw(interp_x, interp_y);
0 个评论
采纳的回答
Steven Lord
2024-6-7
Just based on the code you showed, the main suggestion I have is not to recreate the scatteredInterpolant object every time. Just change the Values property to each of your different data sets. That way the effort to create the internal information necessary to perform the interpolation based on the coordinates (which are the same each time) doesn't need to be repeated. See the "Replacement of Sample Values" example on that documentation page.
Alternately if you're using release R2023b or later, you could use the functionality introduced in that release to "Interpolate multiple data sets simultaneously" (see the Version History section of the documentation page.)
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!