question regarding dividing squares figure into multiple square figures in matlab
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a 30 X 30 bounding box with maximum and minimum latitude and longitude. Let it be denoted as (latMin,lonMin) and (latMax,lonMax). I would like to divide this bounding box into 16 squares and extract the latitude and longitude for each square. For 4 squares I can simply do the following: centLon = (minLon + maxLon)/2.0; centLat = (minLat + maxLat)/2.0;
and the four boxes that I get will be: bbox0 = (minLon, centLon, minLat, centLat); bbox1 = (centLon, maxLon, minLat, centLat); bbox2 = (minLon, centLon, centLat, maxLat); bbox3 = (centLon, maxLon, centLat, maxLat);
but this would be tedious for 16 boxes. Is there a better way?
0 commentaires
Réponses (1)
Walter Roberson
le 13 Juin 2015
divisions = 4;
LAT = linspace(latMin, latMax,divisions+1);
LONG = linspace(longMin, longMax,divisions+1);
Bonding box (J,K) runs from LAT(J) to LAT(J+1), LONG(K) to LONG(K+1)
Voir également
Catégories
En savoir plus sur Entering Commands 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!