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!