netCDF save to variable
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 NetCDF에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!