2D grid interpolation problem
3 views (last 30 days)
Show older comments
Luke Blades
on 17 Apr 2016
Commented: Taindra Neupane
on 1 Oct 2020
Hello,
I'm having trouble with 2d interpolation using interp2.
I have a grid of data, 200x200. I've plotted the surface and there are some values missing from my data set. I need to calculate the volume beneath this surface and to do that i need to get rid of any NaN values so the trapz function will work.
I've tried using interp2 but i get the error "Interpolation requires at least two sample points in each dimension."
There is no row or column in my data matrix which is composed entirely of NaN. Is it an issue if there are several NaN values in a row (does it interpolate between values 1 cell apart)?
Any help greatly appriciated, this is driving me nuts!
Many thanks,
Luke
1 Comment
Taindra Neupane
on 1 Oct 2020
Hello Friends,
I have a 2d uniformly gridded data (like an image or dose with specific voxel size), I am looking for interpolation funtion to divide into +ve interger as well as non-integer values like 1, 1.5,2....! I am using interpn (A,k) or interpn2 (A,k) but its interpolating only into even +ve intergers points/values like k=0, no interpolation, k=1, two values, k=2, 4 values as it divide into 2^k -1 values. So, I am wondering if I want to divide 3mmx3mm pixel into 1mmx1mm pixel (3 sections). Please help me on this.
Thanks in advance!
Accepted Answer
More Answers (0)
See Also
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!