Matlab interpolation of a hemisphere to a finer grid

조회 수: 3 (최근 30일)
mldmnn
mldmnn 2018년 9월 3일
댓글: Koundinya 2018년 9월 11일
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