Why doesn't SIZEM respect the order of elements in the longitude limit inputs?

1 view (last 30 days)
According to the documentation,
[r,c] = sizem(latlim,lonlim,scale) returns the required size for a regular matrix map lying between the latitude and longitude limits specified by the two-element input vectors latlim and lonlim, which are of the form [south-limit north-limit] and [west-limit and east-limit], respectively.
However, when I specify longitude limits of [45 -45], so the map spans from 45 degrees east to 45 degrees west, it returns the same results as when the longitude limits are [--45 45], or 45 degrees west to 45 degrees east. So it appears that SIZEM is not resecting the order of elements inside the input variable.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
This is a bug in Mapping Toolbox 1.3.
The problem is occurring because SIZEM uses the difference between the minimum and maximum elements of the longitude limit, instead of respecting the order of the elements.
As a workaround, you can convert the the longitude limits to the 0 - 360 degree range, with ZERO22PI as shown in the following example:
[r,c] = sizem([0 45], zero22pi([45 -45]), 1)

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!