how to use Matlab netCDF functions for 4 dimensions data?
Show older comments
I have data with four dimensions, there are (lon,lat,level,time). I have no idea what should I do with this kind of data.. this is the display of my data:
Variablename Size: 249x249x34x2 Dimensions: west_east,south_north,bottom_top,Time Datatype: single Attributes: FieldType = 104 MemoryOrder = 'XYZ' description = 'pm10 dry mass' units = 'ug m^-3' stagger = '' coordinates = 'XLONG XLAT'
% code
clc
clear
file = 'F:\...\';
data = double (ncread(file,'variablename'));
DATA = squeeze(data(:,:,1,1)); % I just think this command usable to 4D data (lon,lat,level,time), I don't know for sure
DATA = log10(DATA);
% lattitude and longitude
lat = double(ncread(file,'XLAT'));
lon = double(ncread(file,'XLONG'));
xlat = lat(1,:,1);
xlon = lon(:,1,1);
[xlat,xlon] = meshgrid(xlat,xlon);
When I use 'surfacem(xlat,xlon,DATA);' with the codes that following above, my result it is not look good, the DATA only shown around the ocean (lat and lon). please give me the suggestions the correct way to read 4D data and get the result from that kind of data.. I really need your help Thank you
1 Comment
Chad Greene
on 9 Jun 2016
If you double-click on DATA in the workspace it will show you the values in DATA. So to identify whether the problem is with surfacem or the underlying DATA, what are the values in DATA?
Accepted Answer
More Answers (1)
Muhammad Usman Saleem
on 9 Jun 2016
0 votes
if you are using NCAR reanalysis then use get_NCAR function to process
Categories
Find more on NetCDF in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!