How to fill and write nc file?

조회 수: 6 (최근 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에서 Variables에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by