Effacer les filtres
Effacer les filtres

There is a 1:1 mapping between the points in 2 separate 3D spaces. How do I pick a new point in one space and interpolate what the point will be in the other space?

2 vues (au cours des 30 derniers jours)
Hi there.
I am conducting an experiment where there are 3 input variables and 3 output variables. I want to pick a desired output state and interpolate based on past data to determine what input variables I should use. So I have two 3-D data sets with a 1 to 1 mapping and want to figure out how to interpolate between them, in either direction.
Any notions about what functions I might employ here? One thought I had was finding the smallest set of points that competely bound the "desired output" point and sort of deforming that 3D shape into the new 3D shape in the other space and seeing where all the internal points end up. Another idea is just picking whatever the closest data point is and mapping to the second space near that point somehow.

Réponse acceptée

Matt J
Matt J le 10 Mai 2023
Modifié(e) : Matt J le 10 Mai 2023
If your data is gridded, use griddedInterpolant. Otherwise, if it is scattered, use scatteredInterpolant. Since you are interpolating data from the output space, I imagine the data would be scattered.
  2 commentaires
Brian le 11 Mai 2023
Thanks. This function doesn't allow you to map between two different 3D spaces directly, but I think I could do it indirectly by calling it multiple times for each independent variable:
1) Define input variables I1, I2, I3 and output variables O1, O2, O3
2) Pass in output variables and just one input variable (i.e. I1)
3) Repeat for the other input variables
So I would call scatteredInterpolant 3 times. Is that sort of what you had in mind?

Connectez-vous pour commenter.

Plus de réponses (2)

Matt J
Matt J le 10 Mai 2023
Modifié(e) : Matt J le 10 Mai 2023
If you have a parametric model for the 1-1 mapping, it might be a good idea to perform a fit to the model using e.g., lsqcurvefit. Then you can use the fitted model to look up points.

Walter Roberson
Walter Roberson le 11 Mai 2023
Modifié(e) : Walter Roberson le 11 Mai 2023
In the general case, you do not do that.
Take two rectangular sheets of rubber the same size. There is obviously a one to one mapping of points. Now take the second sheet and select a finite number of points on it that are not touching each other, and raise or lower each by a finite distance, allowing the points between to move vertically to maintain continuity. This clearly has a one to one correspondence with the first sheet, each (x, y, z) on the first having moved to (x, y, z'). The existence of some continuous mathematical mapping function between the two seems clear, but it could be fairly complicated: you can use a 2d extension of Lagrange polynomials to build the mapping function. It could end up being quite complicated but it exists.
Now take that and stretch and squeeze the rectangular area boundaries. As long as you do not tear the sheet or fold it back onto itself, obviously one to one mapping continues to exist. Does a mapping function exist, (x, y, z) to (x', y', z')? I guess it must. Is it a practical function to construct in continuous space? Probably not so practical.
Basically you are asking how to create a continuous function to map between any two bounded spaces with the same topology. Which clearly gets very very messy.
Can it always be done in principle, that you can always (in principle) construct a continuous function to describe a situation in which one-to-one mapping exists? No. There are other ways selecting points that do not preserve continuity but the mapping is still one-to-one. Fractal selection methods. Or see how messy matters can get if you look at the Banach-Tarski paradox, https://www.quantamagazine.org/how-a-mathematical-paradox-allows-infinite-cloning-20210826/


En savoir plus sur Interpolation dans Help Center et File Exchange




Community Treasure Hunt

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

Start Hunting!

Translated by