How to make animation from netcdf file?
Show older comments
Hi all,
Now, i have success make contour from netcdf file.. and now i want create animation from this netcdf.. teach me how i can do it with fluent.
as example may be you can continue this script:
ncid=netcdf.open('sst2016b.nc','write');
lon=ncread('sst2016b.nc','longitude');
lat=ncread('sst2016b.nc','latitude');
time=ncread('sst2016b.nc','time');
lat=double(lat);
lon=double(lon);
time=double(time);
waktu=(time)/24+datenum('1900-01-01 00:00:00');
suhu=netcdf.getVar(ncid,3, [0 0 0],[25 25 31]); % from here i want make animation
suhu=double(suhu);
scale=netcdf.getAtt(ncid,3,'scale_factor');
offset=netcdf.getAtt(ncid,3,'add_offset');
suhub=suhu*scale+offset;
suhub=double(suhub);
[X,Y]=meshgrid(lat,lon);
%Z=griddata(lon,lat,suhub,Y,X); % i'm sorry i'm also stuck here, because suhub have matrix 25*25*31 while griddata can't workly when dimension matrix greater than two
%s=pcolor(lon,lat,Z);
%shading interp;
% from reference, after the above script we must do looping function.. correct if i'm wrong..
% are i'm right we must use set command?
% i'm confuse what different drawnow and pause command?
so, i want sst contour is change respect to time
tks for your help.. :)
Accepted Answer
More Answers (0)
Categories
Find more on NetCDF in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!