Interpolate Scattered Data on another mesh
Show older comments
Hi, I have two Sets of scattered Data. They consist of the ccordinates x,y,z and a Temperatur for every point. I want to compare them pointwise but the x,y,z points are not identical. I thought I could interpolate them on the same x,y,z data for the first data set with scatteredInterpolant but that does not work because the number of the points are not identical. Something like a meshgrid is not really a option in my case.
Thanks for any help
2 Comments
Bruno Luong
on 15 Nov 2022
Edited: Bruno Luong
on 15 Nov 2022
"... that does not work because the number of the points are not identical"
That doesn't sound right
Assuming you have
- m points (x1,y1,z1) and m T1 temperature values, meaning they are all vectors of length m
- n points (x2,y2,z2) and n T2 temperature values, they are all vectors of length n
Then when you do
T1fun = scatteredInterpolant(x1, y1, z1, T1);
T1inter = T1fun(x2, y2, z2);
you"ll get T1inter avec vector of length n, so it has the same length n as T2 and it CAN be compared to T2.
If not please show your code.
John D'Errico
on 15 Nov 2022
Edited: John D'Errico
on 15 Nov 2022
My guess is, the comparison was done incorrectly. That is, set1 has N1 number of points, while set2 has N2 number of points.
So set1 was was interpolated into the surface for set2. The interpolationdoes not change the number of points in that data set, so you cannot compare them. HOWEVER, you can compare the interpolated values for set2 on set 1, to the actual values for set2. They will have the same number of points, as long as you are careful in dealing with the NaNs, which will indicate a point that was outside of the convex hull of the other set.
Accepted Answer
More Answers (0)
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!