Hi, I'm trying to use USGS DEMs in MATLAB but after reading it in with geotiffread, mapshow produces an error. Based on the documentation, I tried
[A, R] = geotiffread('NED_10340081')figuremapshow(A, R);
but I get
Error using mapshowExpected input number 1, I or X or RGB, to be one of these types: uint8, uint16, double, logicalInstead 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{:});
My matrix A is of type single…is that the problem? and how do I fix this? Thanks
Best Answer