Ploting or seeing 3/4D Weather Data NC4 file in MATLAB

3 ビュー (過去 30 日間)
Abdul Moeez Baig
Abdul Moeez Baig 2022 年 8 月 7 日
回答済み: KSSV 2022 年 8 月 7 日
I am supposed to read an NC4 file and check for weather data. I only started working on it and the following is the code:\
The file is actually an air density file where var1 is 848*824 order, var2 = 848*824 and var3= 848*824*744 order. The extra dimension in var3 is that of time and because of it, the pcolor is not working I think. How can I remove this dimension ? I don't need time I just want a plot perhaps , var1 and 2 are lats and longs on geo map, var3 is the air density but has time in it.
ncfile = 'filename'
ncinfo(ncfile)
ncdisp(ncfile)
myvar1 = ncread(ncfile,'var') ;
myvar2 = ncread(ncfile,'var') ;
myvar3 = ncread(ncfile,'var') ;
pcolor(myvar1,myvar2,myvar3)
shading interp
colorbar

採用された回答

KSSV
KSSV 2022 年 8 月 7 日
pcolor can be worked on only a matrix. You var3 is a 3D matrix.
pcolor(var1,var2,var3(:,:,i)) ; % where i = 1,2,.....744
Also have a look on slice.

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by