我正在尝试在 MATLAB 中使用 USGS DEM,但在使用 geotiffread 读取它后,mapshow 会产生错误。根据文档,我尝试了
[A, R] = geotiffread('NED_10340081')
figure
mapshow(A, R);
但我明白了
Error using mapshow
Expected input number 1, I or X or RGB, to be one of these types:
uint8, uint16, double, logical
Instead its type was single.
Error in validateMapRasterData>parseImageInputs (line 109)
validateattributes(A, {'uint8', 'uint16', 'double', 'logical'}, ...
Error in validateMapRasterData>validateImageComponent (line 93)
[A, R] = parseImageInputs(mapfcnname, dataArgs{:}, cmap, rules );
Error in validateMapRasterData (line 27)
[Z, SpatialRef] = validateImageComponent(mapfcnname, ...
Error in maprastershow (line 127)
[Z, SpatialRef, displayType, HGpairs] = ...
Error in mapshow (line 231)
h = showFcn(varargin{:});
我的矩阵 A 是单一类型的......这是问题吗?我该如何解决这个问题?这是 DEM 的下载链接http://snowserver.colorado.edu/pub/fromDominik/NED_10340081.zip 谢谢 PS 我在http://www.mathworks.com/matlabcentral/answers/38255-display-usgs交叉发布了这个-dem-using-geotiffread-and-mapshow