MATLAB: Label Polygons in Mapshow

geoshowlabel;mapshowMATLAB

Hi
I have a shapefile of zip codes of NYC. When I use the code, I get this pic and a structure is created, where zip codes are listed in column 5 of the structure. How can I label these zip codes on the map, where it shows?
Thanks,
Candace
%S = shaperead('ZipCode1.shp','UseGeoCoords',true);
S = shaperead('ZipCode1.shp')
mapshow(S)

Best Answer

You may find internal point of bounding boxes and use text function.
for i=1:263
meanValue = mean(S(i).BoundingBox);
text(meanValue(1),meanValue(2),num2str(S(i).ZIPCODE))
end