필터 지우기
필터 지우기

question regarding dividing squares figure into multiple square figures in matlab

조회 수: 1 (최근 30일)
John
John 2015년 6월 12일
댓글: John 2015년 6월 15일
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?

답변 (1개)

Walter Roberson
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 CenterFile Exchange에서 Feature Detection and Extraction에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by