How to access a variable stored in group

36 views (last 30 days)
Sreeraj R
Sreeraj R on 8 Oct 2021
Answered: KSSV on 12 Oct 2021
hi, i am currently working on tropomi data and the i am trying to read the nitrogendioxide tropospheric column data from the NetCDF file. however the column data is not saved under variables but is saved under variables in the Group folder. the variable path is like this Groups:/PRODUCTS/Variables: nitrogendioxide_tropospheric_column. what code can i use to read this variable. i already tried ncread(tropomi,'nitrogendioxide_tropospheric_column') but it gave an error saying the variable doesnt exist in the file. kindly help me to read this data

Answers (1)

KSSV
KSSV on 12 Oct 2021
file1 = 'tropomi1.nc' ;
file2 = 'tropomi2.nc' ;
x1 = ncread(file1,'/PRODUCT/longitude');
y1 = ncread(file1,'/PRODUCT/latitude');
z1 = ncread(file1,'/PRODUCT/nitrogendioxide_tropospheric_column') ;
x2 = ncread(file2,'/PRODUCT/longitude');
y2 = ncread(file2,'/PRODUCT/latitude');
z2 = ncread(file2,'/PRODUCT/nitrogendioxide_tropospheric_column') ;

Community Treasure Hunt

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

Start Hunting!