Interpolate Scattered Data on another mesh

7 visualizzazioni (ultimi 30 giorni)
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 Commenti
Bruno Luong
Bruno Luong il 15 Nov 2022
Modificato: Bruno Luong il 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
John D'Errico il 15 Nov 2022
Modificato: John D'Errico il 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.

Accedi per commentare.

Risposta accettata

John D'Errico
John D'Errico il 15 Nov 2022
Modificato: John D'Errico il 15 Nov 2022
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.

Più risposte (0)

Categorie

Scopri di più su Interpolation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by