2D circular interpolation (theta, phi) angles
Show older comments
Hi, I have a 2D matrix Z that is function of theta and phi coordinates Z(theta,phi). I have a regular grid of theta and phi coordinates along with the value of Z. Then, I have some scattered points theta_i and phi_i for which I want to interpolate the value of Z. This I can do it easily by doing:
Z_i = interp2(theta,phi,Z);
However, the sampling of matrix Z is limited. For example, if the theta and phi step is 1 degree (then theta from 0:1:179 and phi 0:1:359), it may happen that a valid scattered point falls at one edge of the sampling. For instance a point (theta_i,phi_i) = (0,359.5) will raise a NaN during interp2 because it does not know how to interpolate. Due to the circular symmetry of (theta, phi) angles in fact Z(0,360) = Z(0,0) so that all information needed for interpolation is there, however how can I make interp2 make aware of this angular symmetry? I realized using 'spline' actually provides a valid number, however I would prefer not to use it. Thanks!
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!