How to fill and write nc file?

3 次查看(过去 30 天)
JAVAD
JAVAD 2023-6-27
回答: JAVAD 2023-6-27
Hi all,
I try to extract some variables from my model's data and put in new file.
I can read and extract data from nc file and create new nc file but in filling the variable I have faced problems.
Is it possible to help me?
My code is:
fname = char('output.nc');
............................................
lon = ncread(fname,'lon');
lat = ncread(fname,'lat');
velocity = ncread(fname,'velocity');
...........................................
nccreate("myexample.nc","lat")
>> nccreate("myexample.nc","lon")
>> nccreate("myexample.nc","velocity")
  1 个评论
Mihir
Mihir 2023-6-27
Can you please share the error which you encountered when filling the variable.

请先登录,再进行评论。

回答(1 个)

JAVAD
JAVAD 2023-6-27
Error in ncwrite (line 87)
ncObj.write(varName, varData, start, stride);

类别

Help CenterFile Exchange 中查找有关 Data Import and Analysis 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by