Read global 5-min digital terrain data
[Z, refvec] = etopo5 reads the topography data for the entire world for the data in the current folder. The current folder is searched first for ETOPO2 binary data, followed by ETOPO5 binary data, followed by ETOPO5 ASCII data from the file names etopo5.northern.bat and etopo5.southern.bat. Once a match is found the data is read. The data grid, Z, is returned as an array of elevations. Data values are in whole meters, representing the elevation of the center of each cell. refvec is the associated three-element referencing vector that geolocates Z.
[Z, refvec] = etopo5(samplefactor) reads the data for the entire world, downsampling the data by samplefactor. samplefactor is a scalar integer, which when equal to 1 gives the data at its full resolution (1080 by 4320 values). When samplefactor is an integer n greater than one, every nth point is returned. samplefactor must divide evenly into the number of rows and columns of the data file. If samplefactor is omitted or empty, it defaults to 1.
[[Z, refvec] = etopo5(samplefactor, latlim, lonlim) reads the data for the part of the world within the specified latitude and longitude limits. The limits of the desired data are specified as two-element vectors of latitude, latlim, and longitude, lonlim, in degrees. The elements of latlim and lonlim must be in ascending order. If latlim is empty the latitude limits are [-90 90]. lonlim must be specified in the range [0 360]. If lonlim is empty, the longitude limits are [0 360].
ETOPO5 is being superseded by ETOPO2 and the TerrainBase digital terrain model. See the tbase external interface function for more information.
Note For details on locating map data for download over the Internet, see the following documentation at the MathWorks Web Site: Finding Geospatial Data.
Read every tenth point in the data set:
% Read and display the ETOPO5 data from the folder 'etopo5' % downsampled by a factor of 10. [Z, refvec] = etopo5('etopo5',10); axesm merc geoshow(Z, refvec, 'DisplayType', 'surface'); demcmap(Z);
Read in data for Korea and Japan at the full resolution:
samplefactor = 1; latlim = [30 45]; lonlim = [115 145]; [Z,refvec] = etopo5(samplefactor,latlim,lonlim); whos Z Name Size Bytes Class Z 180x360 518400 double array