Matlab interpolation of a hemisphere to a finer grid

4 ビュー (過去 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 Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by