Matlab interpolation of a hemisphere to a finer grid
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Koundinya
am 11 Sep. 2018
how are you using the griddata and interp functions here ? It would be easier to understand the error if you post the complete code
Antworten (0)
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!