How to save "char" datatype column data into the NetCDF file along with "int32", "single", and ''double" datatype column data?
조회 수: 4 (최근 30일)
이전 댓글 표시
I have "int32", "single", ''double" and "char" datatype of column data in the attached mat format file (26.8 kb). I want to save all the data into a NetCDF file without changing the size of other variables. But I am getting errors until I am not making the size equal to the variable. Can someone tell me how to put the following four variables into ncfile?
load('gdp_hourly_velocities_f86e_04a9_23f1.mat')
ld1=gdp_hourly_velocities.drogue_lost_date;
lt1=gdp_hourly_velocities.latitude;
rw1=gdp_hourly_velocities.rowsize;
st1=gdp_hourly_velocities.DeploymentStatus;
nccreate('ncfile.nc','ld1','Dimensions',{'ld1',1,size(ld1,1)},'Datatype','double');
ncwrite('ncfile.nc','ld1',ld1);
nccreate('ncfile.nc','lt1','Dimensions',{'lt1',1,size(lt1,1)},'Datatype','single');
ncwrite('ncfile.nc','lt1',lt1);
nccreate('ncfile.nc','rw1','Dimensions',{'rw1',1,size(rw1,1)},'Datatype','int32');
ncwrite('ncfile.nc','rw1',rw1);
nccreate('ncfile.nc','st1','Dimensions',{'st1',4,size(st1,1)},'Datatype','char');
ncwrite('ncfile.nc','st1',st1);
댓글 수: 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!