You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
scatteredInterpolant: what is linear interpolation in 2d?
Accepted Answer
31 Comments
Say, supportPts is my input (nx2) matrix which contains n pairs of x and y coordinates in arbitrary order that define a rectangular grid. The goal should be to derive a griddedInterpolant without hard-coding it for a specific n.
Would
Interp=griddedInterpolant(unique(sort(supportPts(:,1)), unique(sort(supportPts(:,2))}, Fval);
work always?
But why would you even be starting with data in such a form? If it's a rectangular grid, you would usually be given the sampling of x and y in separate vectors from the beginning, which is the input format that meshgrid, ndgrid, and various other grid operation commands require.
Well, I come from a finite-element-like context. There, the degrees of freedom (the Fval's) and the corresponding points where they are defined (the supportPts) are sorted to reduce the bandwidth of a linear system. That's why I do not start with vectors x and y as you suggested but have pairs of coordinates in a random order.
GriddedInterpolant does not divide the elements into triangles but rather performs a bilinear interpolation?
More Answers (0)
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)