How to ncread a variable with spaces in its title?

조회 수: 3 (최근 30일)
Mikolaj Jankowski
Mikolaj Jankowski 2019년 2월 13일
댓글: Mikolaj Jankowski 2019년 2월 13일
I have a fairly simple problem, however its solution keeps evading me. Data I have has a variable whose name has spaces in it.
I tried ignoring the spaces, putting it in brackets, adding / symbol etc, but so far nothing of the kind worked.
I would greatly appeciate a suggestion
Title of variable is 'sea ice concentration'
for k=2013:2013 %2018
si_masam_aug = ncread(['Masam2_' int2str(k) 'august.nc'],sea\ ice\ concentration);
si_masam_sept = ncread(['Masam2_' int2str(k) 'september.nc'],sea\ ice\ concentration);
masam_aug{k-2012} = si_masam_aug;
masam_sept{k-2012} = si_masam_sept;
end

채택된 답변

Pavel
Pavel 2019년 2월 13일
Could you please show your data?
Have you tried to use quotes?
ncread(...,'sea ice concentration')
  댓글 수: 2
Mikolaj Jankowski
Mikolaj Jankowski 2019년 2월 13일
I did try all those options as well as in quoutes:
sea ice concentration
seaiceconcentration
sea_ice_concentration
sea\ice\concentration
I need to figure out how to upload a file here :D, unless ncdisp output is enough
ncdisp('Masam2_2013august.nc')
Source:
C:\Users\Mikolaj\Documents\MATLAB\Dissertation_datasets\Ice_2013_onward\Masam2_2013august.nc
Format:
netcdf4
Dimensions:
t = 31
y = 2550
x = 2100
Variables:
Longitude
Size: 2100x2550
Dimensions: x,y
Datatype: single
Attributes:
units = 'degrees east'
long-name = 'Longitude'
Latitude
Size: 2100x2550
Dimensions: x,y
Datatype: single
Attributes:
units = 'degrees north'
long-name = 'Latitude'
Day of Month
Size: 31x1
Dimensions: t
Datatype: int32
Attributes:
units = 'day of month'
long-name = 'Day of August 2013'
sea ice concentration
Size: 2100x2550x31
Dimensions: x,y,t
Datatype: int8
Attributes:
units = '%'
long-name = 'sea ice concentration'
key = '0-100=sea ice concentration [%], 110=missing, 120=land, 104=ocean out of AMSR2 bounds, 119=land out of AMSR2 bounds'
Mikolaj Jankowski
Mikolaj Jankowski 2019년 2월 13일
File itself is too big to upload, even in zipfile

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 NetCDF에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by