How to filter the required coordinates which consist with same elevation?

1 ビュー (過去 30 日間)
Ravindu Lokuliyana
Ravindu Lokuliyana 2019 年 3 月 22 日
コメント済み: Ravindu Lokuliyana 2019 年 3 月 22 日
Hi there,
I have a netCDF dataset which consists of longitudes (1xN), latitudes (Mx1) and different elevations (MxN). I need to filter the lat/lon coordinates which are having zero (0 m) elevation and save those coordinates in a seperate text file.
I have used following line of codes to extract the netCDF data, but struggling the filtering part.
filename = 'elevations.nc';
elev = ncread(filename, 'elevation')';
lon = ncread(filename, 'lon')';
lat = ncread(filename, 'lat');
I would greatly appreciate anyone can help me to solve this problem.
Thank you.

採用された回答

KSSV
KSSV 2019 年 3 月 22 日
filename = 'elevations.nc';
elev = ncread(filename, 'elevation')';
lon = ncread(filename, 'lon')';
lat = ncread(filename, 'lat');
[c,h] = contour(lon,lat,elev,'showtext','on','LevelList',0) ;
YOu have your o contour coordinates in c.
  1 件のコメント
Ravindu Lokuliyana
Ravindu Lokuliyana 2019 年 3 月 22 日
That was quick.
Thanks a lot.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by