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 Center および File ExchangeVariables についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by