Interpolate Scattered Data on another mesh

6 次查看(过去 30 天)
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 个评论
Bruno Luong
Bruno Luong 2022-11-15
编辑:Bruno Luong 2022-11-15
"... 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
John D'Errico 2022-11-15
编辑:John D'Errico 2022-11-15
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.

请先登录,再进行评论。

采纳的回答

John D'Errico
John D'Errico 2022-11-15
编辑:John D'Errico 2022-11-15
But what is the problem?
  1. Using scatteredInterpolant, interpolate set 2 (x,y,z) using the data for set 1.
  2. Some of the points from set 2 will lie outside of the convex hull. That will be flagged because it will generate a NaN.
  3. Discard all points where a NaN resulted, as they correspond to points that have no way to form a comparison.
You can now consider the difference between the two sets. Note that near the boundaries of any such interpolant, there will often be problems of approximation. This is completely expected.
Make sure however, that you are comparing the INTERPOLATED values for one set to the actual values for that same set.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by