Populating array help for Earth grid creation
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Scott Hunter
le 15 Juin 2019
Réponse apportée : Scott Hunter
le 15 Juin 2019
I want to create an array of 3-coordinate points (azimuth, elevation and R) in the shape of a sphere (to get and Earth grid), but am currently struggling. I've been trying with both sph2cart and just the sphere function but can't figure out how to get my X,Y,Z (or az,el,R) data for each point. Currently I've been trying;
res = 20; %resolution of Earth grid
R = 100;
LDA = -pi:2*pi/res:pi;
PHI = -pi/2:pi/res:pi/2;
for ii = 1:length(LDA)^2
for jj = 1:length(LDA)
for kk = 1:length(PHI)
point(ii,:) = [LDA(jj) PHI(kk) R];
end
end
end
I'm aware this doesn't work because it just overwrites every time the loop number changes, but it helps illustrate that I want my points in an array with 3 collumns for comparing to other points that I'll have later. Is there a better way to do this?
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Earth and Planetary Science dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!