how to plot 3D data using NetCDF files ?

14 vues (au cours des 30 derniers jours)
Mario Mohomes
Mario Mohomes le 28 Mai 2021
Réponse apportée : KSSV le 28 Mai 2021
I'm trying to create a 3D plot in Matlab using a NetCDF file
I'm having a hard time starting
Matlab R2020a

Réponses (1)

KSSV
KSSV le 28 Mai 2021
Reading ncfile is very easy in MATLAB. You need to know only very few functions. Read about ncdisp, ncread.
ncfile = 'san_diego_bay_P020_2017.nc' ;
lon = ncread(ncfile,'lon') ;
lat = ncread(ncfile,'lat') ;
B = ncread(ncfile,'Band1') ;
pcolor(lon,lat,B')
shading interp
colorbar

Tags

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by