Populating array help for Earth grid creation
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Scott Hunter
am 15 Jun. 2019
Beantwortet: Scott Hunter
am 15 Jun. 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 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Earth and Planetary Science 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!