Effacer les filtres
Effacer les filtres

question regarding dividing squares figure into multiple square figures in matlab

2 vues (au cours des 30 derniers jours)
John
John le 12 Juin 2015
Commenté : John le 15 Juin 2015
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?

Réponses (1)

Walter Roberson
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)
  1 commentaire
John
John le 15 Juin 2015
I didn't quite understand your answer. What is J and K? What are its limits?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Feature Detection and Extraction 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!

Translated by