netCDF save to variable

1 回表示 (過去 30 日間)
George
George 2015 年 10 月 8 日
編集済み: George 2015 年 10 月 8 日
Hello all
I have a problem saving all the contents of a netCDF file into a structure I keep getting dimension mis-match I would be grateful if you give me any pointers. I know how to open the netCDF and extract point data according to lat, lon, though the process I want to do now is just to save every field (MxN) matrix into a field with increasing numbering (representing 1st measurement, end et.)
this is code thus far
A='file201001';
ncdisp([A'.nc']);
x=ncread([A'.nc'],'hs');
lat=ncread([A'.nc'],'latitude');
lat= rot90(lat, -1);
lat=fliplr(lat);
lon=ncread([A'.nc'],'longitude');
lon= rot90(lon, -1);
lon=fliplr(lon);
[s1,s2,s3]=size(x)
for i=1:s3
B=x(:,:,i);
%B= rot90(B, -1); % These can be omitted since they are just netCDF specific for me to bring the file into a format easier to visualize
%B=fliplr(B);
%contourf(B)
%shading flat
end
Any help is welcome
thanks in advance

回答 (0 件)

カテゴリ

Help Center および File ExchangeNetCDF についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by