question regarding dividing squares figure into multiple square figures in matlab
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Walter Roberson
2015-6-13
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)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Entering Commands 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!