Faster 2D Interpolation?
24 ビュー (過去 30 日間)
古いコメントを表示
I need to interpolate 2D scattered data onto a fine grid. Below is what I am currently doing, and my question is whether there exists a faster a way? Currently my largest data sets (on the order of 3000 x 15000 after up-sampling) take upwards of 7 minutes to run. Preferably this would be a few seconds, but maybe that is asking too much...Similar to my other questions I am unable to provide the exact code for a variety of reasons, but I have listed the steps that I currently perform:
- User selects a subset of the input data to view, which is not unifornly spaced.
- Generate equally space points using Linspace (based on the max and min values of my input data set)
- Create the new grid using Meshgrid
- Generate interpolated data set using griddata(old_x,old_y,old_data,new_x,new_y,'nearest')
I have tried running this from a separate function file, from the command window, and as a private function inside my app designer app. They are all very very slow. Would another 2D interpolation technique be better for my appliciation?
Thank you so much!
0 件のコメント
回答 (1 件)
Steven Lord
2022 年 5 月 2 日
How many times are you performing this interpolation?
Are the old X and Y coordinates the same each time you perform the interpolation, with only the data and the new coordinates changing?
If so consider creating a griddedInterpolant, updating the Values property (but leaving the old coordinate data alone) when you get new data, and evaluating it at each set of new coordinates.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!