NCfileからデータを読み取る方法
2 views (last 30 days)
Show older comments
NCfileからデータ(144×73)を取り出したいのですがうまくいかず、ご存知の方いらしましたら教えて頂きたいです。 以下ファイルの内容です
Format:
64bit
Global Attributes:
Conventions = 'CF-1.6'
history = '2016-11-29 01:21:46 GMT by grib_to_netcdf-1.18.0: grib_to_netcdf /data/data01/scratch/_mars-atls12-95e2cf679cd58ee9b4db4dd119a05a8d-_AeKWY.grib -o /data/data01/scratch/_grib2netcdf-atls05-95e2cf679cd58ee9b4db4dd119a05a8d-P98U21.nc -utime'
Dimensions:
longitude = 144
latitude = 73
time = 1 (UNLIMITED)
Variables:
longitude
Size: 144x1
Dimensions: longitude
Datatype: single
Attributes:
units = 'degrees_east'
long_name = 'longitude'
latitude
Size: 73x1
Dimensions: latitude
Datatype: single
Attributes:
units = 'degrees_north'
long_name = 'latitude'
time
Size: 1x1
Dimensions: time
Datatype: int32
Attributes:
units = 'hours since 1900-01-01 00:00:0.0'
long_name = 'time'
calendar = 'gregorian'
u10
Size: 144x73x1
Dimensions: longitude,latitude,time
Datatype: int16
Attributes:
scale_factor = 0.00028942
add_offset = 0.63856
_FillValue = -32767
missing_value = -32767
units = 'm s**-1'
long_name = '10 metre U wind component'
Accepted Answer
KSSV
on 30 Nov 2016
Edited: KSSV
on 30 Nov 2016
myncfile = 'yourncfile' ; % your nc file with extension .nc
lon = ncread(myncfile,'longitude') ; % read longiutde
lat = ncread(myncfile,'latitude') ; % rea dlatitude
time = ncread(myncfile,'time') ; % get time
u10 = ncread(myncfile,'u10') ; % get variable u10
More Answers (0)
See Also
Categories
Find more on NetCDF in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!