n matlab, I am trying to extract netcdf data for a vector of latitude and longit
ID: 3843858 • Letter: N
Question
n matlab, I am trying to extract netcdf data for a vector of latitude and longitudes to develop a time series. My code only produces a time series for an individual lat long value. Can someone please help me code a matlab program that will let me plot a vector of lat long values? My code is attached below, thank you. lat=nc_varget('/Users/Ajanardhanan/Documents/MATLAB/Complete_TMAX_LatLong1.nc','latitude'); lon=nc_varget('/Users/Ajanardhanan/Documents/MATLAB/Complete_TMAX_LatLong1.nc','longitude'); t=nc_varget('/Users/Ajanardhanan/Documents/MATLAB/Complete_TMAX_LatLong1.nc','temperature'); time=nc_varget('/Users/Ajanardhanan/Documents/MATLAB/Complete_TMAX_LatLong1.nc','time'); a=find(lon==72.5); b=find(lat==30.5); r=t(:,b,a); plot(time,r)
Explanation / Answer
There are data sets that contain data with coordinates in lat and long in units of degrees. The example shows how to import geographic data with coordinates in lat and long, display geographic data in a map display and change the display.
We will see how to-
(1) Import specific geographic vector and raster data sets
(2)Create map displays and visualize the data
(3) Display multiple data sets in a single map display
(4) Customize a map display with a scale ruler and north arrow.
This is expalined in details as follows-
(1) Import Polygon Geographic Vector Data
Geographic vector data can be stored in adifferent formats like shapefiles, GPS Exchange, NetCDF, HDF4, or HDF5 and specific vector data products such as Vector Smart Map Level 0, and the Global Self-Consistent Hierarchical High-Resolution Geography. The example import the polygon geographic vector data from a shapefile. Vertices in a shapefile can be in geographic coordinates (latitude and longitude) or in a projected coordinate reference system. Foe eg:
(2) Display Polygon Geographic Vector Data
Display the polygon geographic vector data onto a map axes. The geographic extent is in the United States, we can use usamap to setup a map axes. Use geoshow to project and display the geographic data onto the map axes. Display an ocean color in the background by setting the frame's face color.
(3) Import point geographic vector data from the boston_placenames.gpx file included with the Mapping Toolbox software. The file contains latitude and longitude coordinates of geographic point features in part of Boston, Massachusetts, USA. Use gpxread to read the GPX file and return a geopoint vector.
Import line vector data from the sample_route.gpx file included with the Mapping Toolbox™ software. The file contains latitude and longitude coordinates for a GPS route from Boston Logan International Airport to The MathWorks, Inc in Natick Massachusetts, USA. Use gpxread to read the GPX file and return a geopoint vector.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.