Matlab interpolation of a hemisphere to a finer grid

4 次查看(过去 30 天)
I've computed data on this hemisphere:
% Compute hemisphere coordinates
segments = 20;
theta = deg2rad(linspace(-180,0,segments))'; % Elevation (bottom half of a sphere)
phi = deg2rad(linspace(-180,180,segments)); % Azimuth
[phi,theta]=meshgrid(phi,theta);
zObsG = obsRadius.*sin(theta);
xObsG = obsRadius.*cos(theta).*cos(phi);
yObsG = obsRadius.*cos(theta).*sin(phi);
I want to interpolate this data now to a finer grid with more elements:
segmentsInterp = 100;
thetaInterp = deg2rad(linspace(-180,0,segmentsInterp))';
phiInterp = deg2rad(linspace(-180,180,segmentsInterp));
[phiInterp,thetaInterp]=meshgrid(phiInterp,thetaInterp);
zObsGInterp = obsRadius.*sin(thetaInterp);
xObsGInterp = obsRadius.*cos(thetaInterp).*cos(phiInterp);
yObsGInterp = obsRadius.*cos(thetaInterp).*sin(phiInterp);
I somehow struggle to use the interp or griddata functions in Matlab as it outputs for example: "The grid must be created from grid vectors which are strictly monotonically increasing." or "The number of input coordinate arrays does not equal the number of dimensions (NDIMS) of these arrays.". Any hints to interpolate the obtained data to the new grid?
Thanks a lot in advance!
  1 个评论
Koundinya
Koundinya 2018-9-11
how are you using the griddata and interp functions here ? It would be easier to understand the error if you post the complete code

请先登录,再进行评论。

回答(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